7
7
# --------------------------------------------------------------------------
8
8
9
9
from copy import deepcopy
10
- from typing import Any , TYPE_CHECKING
10
+ from typing import Any , Optional , TYPE_CHECKING , cast
11
11
from typing_extensions import Self
12
12
13
13
from azure .core .pipeline import policies
14
14
from azure .core .rest import HttpRequest , HttpResponse
15
+ from azure .core .settings import settings
15
16
from azure .mgmt .core import ARMPipelineClient
16
17
from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
18
+ from azure .mgmt .core .tools import get_arm_endpoints
17
19
18
20
from . import models as _models
19
21
from ._configuration import SearchManagementClientConfiguration
20
- from ._serialization import Deserializer , Serializer
22
+ from ._utils . serialization import Deserializer , Serializer
21
23
from .operations import (
22
24
AdminKeysOperations ,
23
25
NetworkSecurityPerimeterConfigurationsOperations ,
24
- OfferingsOperations ,
25
26
Operations ,
26
27
PrivateEndpointConnectionsOperations ,
27
28
PrivateLinkResourcesOperations ,
@@ -41,8 +42,6 @@ class SearchManagementClient(SearchManagementClientOperationsMixin): # pylint:
41
42
42
43
:ivar operations: Operations operations
43
44
:vartype operations: azure.mgmt.search.operations.Operations
44
- :ivar offerings: OfferingsOperations operations
45
- :vartype offerings: azure.mgmt.search.operations.OfferingsOperations
46
45
:ivar admin_keys: AdminKeysOperations operations
47
46
:vartype admin_keys: azure.mgmt.search.operations.AdminKeysOperations
48
47
:ivar query_keys: QueryKeysOperations operations
@@ -68,25 +67,27 @@ class SearchManagementClient(SearchManagementClientOperationsMixin): # pylint:
68
67
:param subscription_id: The unique identifier for a Microsoft Azure subscription. You can
69
68
obtain this value from the Azure Resource Manager API or the portal. Required.
70
69
:type subscription_id: str
71
- :param base_url: Service URL. Default value is "https://management.azure.com" .
70
+ :param base_url: Service URL. Default value is None .
72
71
:type base_url: str
73
- :keyword api_version: Api Version. Default value is "2025-02 -01-preview ". Note that overriding
74
- this default value may result in unsupported behavior.
72
+ :keyword api_version: Api Version. Default value is "2025-05 -01". Note that overriding this
73
+ default value may result in unsupported behavior.
75
74
:paramtype api_version: str
76
75
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
77
76
Retry-After header is present.
78
77
"""
79
78
80
79
def __init__ (
81
- self ,
82
- credential : "TokenCredential" ,
83
- subscription_id : str ,
84
- base_url : str = "https://management.azure.com" ,
85
- ** kwargs : Any
80
+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
86
81
) -> None :
82
+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
83
+ _endpoints = get_arm_endpoints (_cloud )
84
+ if not base_url :
85
+ base_url = _endpoints ["resource_manager" ]
86
+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
87
87
self ._config = SearchManagementClientConfiguration (
88
- credential = credential , subscription_id = subscription_id , ** kwargs
88
+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
89
89
)
90
+
90
91
_policies = kwargs .pop ("policies" , None )
91
92
if _policies is None :
92
93
_policies = [
@@ -105,14 +106,13 @@ def __init__(
105
106
policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
106
107
self ._config .http_logging_policy ,
107
108
]
108
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
109
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
109
110
110
111
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
111
112
self ._serialize = Serializer (client_models )
112
113
self ._deserialize = Deserializer (client_models )
113
114
self ._serialize .client_side_validation = False
114
115
self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
115
- self .offerings = OfferingsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116
116
self .admin_keys = AdminKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117
117
self .query_keys = QueryKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118
118
self .services = ServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
0 commit comments