88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
1213from azure .core .pipeline import policies
1314from azure .core .rest import HttpRequest , HttpResponse
2526 PrivateLinkResourcesOperations ,
2627 QueryKeysOperations ,
2728 SearchManagementClientOperationsMixin ,
29+ ServiceOperations ,
2830 ServicesOperations ,
2931 SharedPrivateLinkResourcesOperations ,
3032 UsagesOperations ,
3133)
3234
3335if TYPE_CHECKING :
34- # pylint: disable=unused-import,ungrouped-imports
3536 from azure .core .credentials import TokenCredential
3637
3738
38- class SearchManagementClient (
39- SearchManagementClientOperationsMixin
40- ): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
41- """Client that can be used to manage Azure AI Search services and API keys.
39+ class SearchManagementClient (SearchManagementClientOperationsMixin ): # pylint: disable=too-many-instance-attributes
40+ """Client that can be used to manage search services and API keys.
4241
4342 :ivar operations: Operations operations
4443 :vartype operations: azure.mgmt.search.operations.Operations
@@ -62,15 +61,18 @@ class SearchManagementClient(
6261 NetworkSecurityPerimeterConfigurationsOperations operations
6362 :vartype network_security_perimeter_configurations:
6463 azure.mgmt.search.operations.NetworkSecurityPerimeterConfigurationsOperations
64+ :ivar service: ServiceOperations operations
65+ :vartype service: azure.mgmt.search.operations.ServiceOperations
6566 :param credential: Credential needed for the client to connect to Azure. Required.
6667 :type credential: ~azure.core.credentials.TokenCredential
6768 :param subscription_id: The unique identifier for a Microsoft Azure subscription. You can
68- obtain this value from the Azure Resource Manager API or the portal. Required.
69+ obtain this value from the Azure Resource Manager API, command line tools, or the portal.
70+ Required.
6971 :type subscription_id: str
7072 :param base_url: Service URL. Default value is "https://management.azure.com".
7173 :type base_url: str
72- :keyword api_version: Api Version. Default value is "2024-06 -01-preview ". Note that overriding
73- this default value may result in unsupported behavior.
74+ :keyword api_version: Api Version. Default value is "2025-05 -01". Note that overriding this
75+ default value may result in unsupported behavior.
7476 :paramtype api_version: str
7577 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
7678 Retry-After header is present.
@@ -127,6 +129,7 @@ def __init__(
127129 self .network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations (
128130 self ._client , self ._config , self ._serialize , self ._deserialize
129131 )
132+ self .service = ServiceOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
130133
131134 def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
132135 """Runs the network request through the client's chained policies.
@@ -153,7 +156,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
153156 def close (self ) -> None :
154157 self ._client .close ()
155158
156- def __enter__ (self ) -> "SearchManagementClient" :
159+ def __enter__ (self ) -> Self :
157160 self ._client .__enter__ ()
158161 return self
159162
0 commit comments