77# --------------------------------------------------------------------------
88
99from copy import deepcopy
10- from typing import Any , TYPE_CHECKING
10+ from typing import Any , Optional , TYPE_CHECKING , cast
1111from typing_extensions import Self
1212
1313from azure .core .pipeline import policies
1414from azure .core .rest import HttpRequest , HttpResponse
15+ from azure .core .settings import settings
1516from azure .mgmt .core import ARMPipelineClient
1617from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
18+ from azure .mgmt .core .tools import get_arm_endpoints
1719
1820from . import models as _models
1921from ._configuration import AppPlatformManagementClientConfiguration
3840 CustomizedAcceleratorsOperations ,
3941 DeploymentsOperations ,
4042 DevToolPortalsOperations ,
43+ EurekaServersOperations ,
4144 GatewayCustomDomainsOperations ,
4245 GatewayRouteConfigsOperations ,
4346 GatewaysOperations ,
47+ JobExecutionOperations ,
48+ JobExecutionsOperations ,
49+ JobOperations ,
50+ JobsOperations ,
4451 MonitoringSettingsOperations ,
4552 Operations ,
4653 PredefinedAcceleratorsOperations ,
5259)
5360
5461if TYPE_CHECKING :
55- # pylint: disable=unused-import,ungrouped-imports
5662 from azure .core .credentials import TokenCredential
5763
5864
59- class AppPlatformManagementClient : # pylint: disable=client-accepts-api-version-keyword, too-many-instance-attributes
65+ class AppPlatformManagementClient : # pylint: disable=too-many-instance-attributes
6066 """REST API for Azure Spring Apps.
6167
6268 :ivar services: ServicesOperations operations
6369 :vartype services: azure.mgmt.appplatform.operations.ServicesOperations
6470 :ivar apms: ApmsOperations operations
6571 :vartype apms: azure.mgmt.appplatform.operations.ApmsOperations
72+ :ivar eureka_servers: EurekaServersOperations operations
73+ :vartype eureka_servers: azure.mgmt.appplatform.operations.EurekaServersOperations
6674 :ivar config_servers: ConfigServersOperations operations
6775 :vartype config_servers: azure.mgmt.appplatform.operations.ConfigServersOperations
6876 :ivar configuration_services: ConfigurationServicesOperations operations
@@ -127,30 +135,40 @@ class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version
127135 :ivar predefined_accelerators: PredefinedAcceleratorsOperations operations
128136 :vartype predefined_accelerators:
129137 azure.mgmt.appplatform.operations.PredefinedAcceleratorsOperations
138+ :ivar jobs: JobsOperations operations
139+ :vartype jobs: azure.mgmt.appplatform.operations.JobsOperations
140+ :ivar job: JobOperations operations
141+ :vartype job: azure.mgmt.appplatform.operations.JobOperations
142+ :ivar job_execution: JobExecutionOperations operations
143+ :vartype job_execution: azure.mgmt.appplatform.operations.JobExecutionOperations
144+ :ivar job_executions: JobExecutionsOperations operations
145+ :vartype job_executions: azure.mgmt.appplatform.operations.JobExecutionsOperations
130146 :param credential: Credential needed for the client to connect to Azure. Required.
131147 :type credential: ~azure.core.credentials.TokenCredential
132148 :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure
133149 subscription. The subscription ID forms part of the URI for every service call. Required.
134150 :type subscription_id: str
135- :param base_url: Service URL. Default value is "https://management.azure.com" .
151+ :param base_url: Service URL. Default value is None .
136152 :type base_url: str
137- :keyword api_version: Api Version. Default value is "2023-12 -01". Note that overriding this
138- default value may result in unsupported behavior.
153+ :keyword api_version: Api Version. Default value is "2024-05 -01-preview ". Note that overriding
154+ this default value may result in unsupported behavior.
139155 :paramtype api_version: str
140156 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
141157 Retry-After header is present.
142158 """
143159
144160 def __init__ (
145- self ,
146- credential : "TokenCredential" ,
147- subscription_id : str ,
148- base_url : str = "https://management.azure.com" ,
149- ** kwargs : Any
161+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
150162 ) -> None :
163+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
164+ _endpoints = get_arm_endpoints (_cloud )
165+ if not base_url :
166+ base_url = _endpoints ["resource_manager" ]
167+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
151168 self ._config = AppPlatformManagementClientConfiguration (
152- credential = credential , subscription_id = subscription_id , ** kwargs
169+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
153170 )
171+
154172 _policies = kwargs .pop ("policies" , None )
155173 if _policies is None :
156174 _policies = [
@@ -169,14 +187,15 @@ def __init__(
169187 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
170188 self ._config .http_logging_policy ,
171189 ]
172- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
190+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
173191
174192 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
175193 self ._serialize = Serializer (client_models )
176194 self ._deserialize = Deserializer (client_models )
177195 self ._serialize .client_side_validation = False
178196 self .services = ServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
179197 self .apms = ApmsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
198+ self .eureka_servers = EurekaServersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
180199 self .config_servers = ConfigServersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
181200 self .configuration_services = ConfigurationServicesOperations (
182201 self ._client , self ._config , self ._serialize , self ._deserialize
@@ -235,6 +254,10 @@ def __init__(
235254 self .predefined_accelerators = PredefinedAcceleratorsOperations (
236255 self ._client , self ._config , self ._serialize , self ._deserialize
237256 )
257+ self .jobs = JobsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
258+ self .job = JobOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
259+ self .job_execution = JobExecutionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
260+ self .job_executions = JobExecutionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
238261
239262 def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
240263 """Runs the network request through the client's chained policies.
0 commit comments