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 NginxManagementClientConfiguration
20- from ._serialization import Deserializer , Serializer
22+ from ._utils . serialization import Deserializer , Serializer
2123from .operations import (
2224 ApiKeysOperations ,
2325 CertificatesOperations ,
3133
3234
3335class NginxManagementClient :
34- """NginxManagementClient .
36+ """// FIXME: (missing-service-description) Add service description .
3537
38+ :ivar operations: Operations operations
39+ :vartype operations: azure.mgmt.nginx.operations.Operations
40+ :ivar deployments: DeploymentsOperations operations
41+ :vartype deployments: azure.mgmt.nginx.operations.DeploymentsOperations
3642 :ivar api_keys: ApiKeysOperations operations
3743 :vartype api_keys: azure.mgmt.nginx.operations.ApiKeysOperations
3844 :ivar certificates: CertificatesOperations operations
3945 :vartype certificates: azure.mgmt.nginx.operations.CertificatesOperations
4046 :ivar configurations: ConfigurationsOperations operations
4147 :vartype configurations: azure.mgmt.nginx.operations.ConfigurationsOperations
42- :ivar deployments: DeploymentsOperations operations
43- :vartype deployments: azure.mgmt.nginx.operations.DeploymentsOperations
44- :ivar operations: Operations operations
45- :vartype operations: azure.mgmt.nginx.operations.Operations
4648 :param credential: Credential needed for the client to connect to Azure. Required.
4749 :type credential: ~azure.core.credentials.TokenCredential
4850 :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4951 :type subscription_id: str
50- :param base_url: Service URL. Default value is "https://management.azure.com" .
52+ :param base_url: Service URL. Default value is None .
5153 :type base_url: str
5254 :keyword api_version: Api Version. Default value is "2024-11-01-preview". Note that overriding
5355 this default value may result in unsupported behavior.
@@ -57,15 +59,17 @@ class NginxManagementClient:
5759 """
5860
5961 def __init__ (
60- self ,
61- credential : "TokenCredential" ,
62- subscription_id : str ,
63- base_url : str = "https://management.azure.com" ,
64- ** kwargs : Any
62+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
6563 ) -> None :
64+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
65+ _endpoints = get_arm_endpoints (_cloud )
66+ if not base_url :
67+ base_url = _endpoints ["resource_manager" ]
68+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
6669 self ._config = NginxManagementClientConfiguration (
67- credential = credential , subscription_id = subscription_id , ** kwargs
70+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
6871 )
72+
6973 _policies = kwargs .pop ("policies" , None )
7074 if _policies is None :
7175 _policies = [
@@ -84,17 +88,17 @@ def __init__(
8488 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
8589 self ._config .http_logging_policy ,
8690 ]
87- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
91+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
8892
8993 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
9094 self ._serialize = Serializer (client_models )
9195 self ._deserialize = Deserializer (client_models )
9296 self ._serialize .client_side_validation = False
97+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
98+ self .deployments = DeploymentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
9399 self .api_keys = ApiKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
94100 self .certificates = CertificatesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
95101 self .configurations = ConfigurationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
96- self .deployments = DeploymentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
97- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
98102
99103 def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
100104 """Runs the network request through the client's chained policies.
0 commit comments