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 SearchManagementClientConfiguration
2022from ._serialization import Deserializer , Serializer
2123from .operations import (
2224 AdminKeysOperations ,
2325 NetworkSecurityPerimeterConfigurationsOperations ,
24- OfferingsOperations ,
2526 Operations ,
2627 PrivateEndpointConnectionsOperations ,
2728 PrivateLinkResourcesOperations ,
@@ -41,8 +42,6 @@ class SearchManagementClient(SearchManagementClientOperationsMixin): # pylint:
4142
4243 :ivar operations: Operations operations
4344 :vartype operations: azure.mgmt.search.operations.Operations
44- :ivar offerings: OfferingsOperations operations
45- :vartype offerings: azure.mgmt.search.operations.OfferingsOperations
4645 :ivar admin_keys: AdminKeysOperations operations
4746 :vartype admin_keys: azure.mgmt.search.operations.AdminKeysOperations
4847 :ivar query_keys: QueryKeysOperations operations
@@ -68,25 +67,27 @@ class SearchManagementClient(SearchManagementClientOperationsMixin): # pylint:
6867 :param subscription_id: The unique identifier for a Microsoft Azure subscription. You can
6968 obtain this value from the Azure Resource Manager API or the portal. Required.
7069 :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 .
7271 :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.
7574 :paramtype api_version: str
7675 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
7776 Retry-After header is present.
7877 """
7978
8079 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
8681 ) -> 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" ])
8787 self ._config = SearchManagementClientConfiguration (
88- credential = credential , subscription_id = subscription_id , ** kwargs
88+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
8989 )
90+
9091 _policies = kwargs .pop ("policies" , None )
9192 if _policies is None :
9293 _policies = [
@@ -105,14 +106,13 @@ def __init__(
105106 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
106107 self ._config .http_logging_policy ,
107108 ]
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 )
109110
110111 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
111112 self ._serialize = Serializer (client_models )
112113 self ._deserialize = Deserializer (client_models )
113114 self ._serialize .client_side_validation = False
114115 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
115- self .offerings = OfferingsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116116 self .admin_keys = AdminKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117117 self .query_keys = QueryKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118118 self .services = ServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
0 commit comments