66# Changes may cause incorrect behavior and will be lost if the code is regenerated. 
77# -------------------------------------------------------------------------- 
88
9- from  typing  import  TYPE_CHECKING 
9+ from  copy  import  deepcopy 
10+ from  typing  import  Any , Optional , TYPE_CHECKING 
1011
12+ from  azure .core .rest  import  HttpRequest , HttpResponse 
1113from  azure .mgmt .core  import  ARMPipelineClient 
1214from  msrest  import  Deserializer , Serializer 
1315
16+ from  . import  models 
17+ from  ._configuration  import  PurviewManagementClientConfiguration 
18+ from  .operations  import  AccountsOperations , DefaultAccountsOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations 
19+ 
1420if  TYPE_CHECKING :
1521    # pylint: disable=unused-import,ungrouped-imports 
16-     from  typing  import  Any , Optional 
17- 
1822    from  azure .core .credentials  import  TokenCredential 
19-     from  azure .core .pipeline .transport  import  HttpRequest , HttpResponse 
20- 
21- from  ._configuration  import  PurviewManagementClientConfiguration 
22- from  .operations  import  AccountsOperations 
23- from  .operations  import  DefaultAccountsOperations 
24- from  .operations  import  Operations 
25- from  .operations  import  PrivateEndpointConnectionsOperations 
26- from  .operations  import  PrivateLinkResourcesOperations 
27- from  . import  models 
28- 
2923
30- class  PurviewManagementClient ( object ) :
24+ class  PurviewManagementClient :
3125    """Creates a Microsoft.Purview management client. 
3226
3327    :ivar accounts: AccountsOperations operations 
@@ -37,63 +31,66 @@ class PurviewManagementClient(object):
3731    :ivar operations: Operations operations 
3832    :vartype operations: azure.mgmt.purview.operations.Operations 
3933    :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations 
40-     :vartype private_endpoint_connections: azure.mgmt.purview.operations.PrivateEndpointConnectionsOperations 
34+     :vartype private_endpoint_connections: 
35+      azure.mgmt.purview.operations.PrivateEndpointConnectionsOperations 
4136    :ivar private_link_resources: PrivateLinkResourcesOperations operations 
4237    :vartype private_link_resources: azure.mgmt.purview.operations.PrivateLinkResourcesOperations 
4338    :param credential: Credential needed for the client to connect to Azure. 
4439    :type credential: ~azure.core.credentials.TokenCredential 
4540    :param subscription_id: The subscription identifier. 
4641    :type subscription_id: str 
47-     :param str base_url: Service URL 
48-     :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. 
42+     :param base_url: Service URL. Default value is 'https://management.azure.com'. 
43+     :type base_url: str 
44+     :keyword int polling_interval: Default waiting time between two polls for LRO operations if no 
45+      Retry-After header is present. 
4946    """ 
5047
5148    def  __init__ (
5249        self ,
53-         credential ,  # type: "TokenCredential" 
54-         subscription_id ,  # type: str 
55-         base_url = None ,  # type: Optional[str] 
56-         ** kwargs   # type: Any 
57-     ):
58-         # type: (...) -> None 
59-         if  not  base_url :
60-             base_url  =  'https://management.azure.com' 
61-         self ._config  =  PurviewManagementClientConfiguration (credential , subscription_id , ** kwargs )
50+         credential : "TokenCredential" ,
51+         subscription_id : str ,
52+         base_url : str  =  "https://management.azure.com" ,
53+         ** kwargs : Any 
54+     ) ->  None :
55+         self ._config  =  PurviewManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
6256        self ._client  =  ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
6357
6458        client_models  =  {k : v  for  k , v  in  models .__dict__ .items () if  isinstance (v , type )}
6559        self ._serialize  =  Serializer (client_models )
66-         self ._serialize .client_side_validation  =  False 
6760        self ._deserialize  =  Deserializer (client_models )
61+         self ._serialize .client_side_validation  =  False 
62+         self .accounts  =  AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
63+         self .default_accounts  =  DefaultAccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
64+         self .operations  =  Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
65+         self .private_endpoint_connections  =  PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
66+         self .private_link_resources  =  PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6867
69-         self .accounts  =  AccountsOperations (
70-             self ._client , self ._config , self ._serialize , self ._deserialize )
71-         self .default_accounts  =  DefaultAccountsOperations (
72-             self ._client , self ._config , self ._serialize , self ._deserialize )
73-         self .operations  =  Operations (
74-             self ._client , self ._config , self ._serialize , self ._deserialize )
75-         self .private_endpoint_connections  =  PrivateEndpointConnectionsOperations (
76-             self ._client , self ._config , self ._serialize , self ._deserialize )
77-         self .private_link_resources  =  PrivateLinkResourcesOperations (
78-             self ._client , self ._config , self ._serialize , self ._deserialize )
79- 
80-     def  _send_request (self , http_request , ** kwargs ):
81-         # type: (HttpRequest, Any) -> HttpResponse 
68+ 
69+     def  _send_request (
70+         self ,
71+         request ,  # type: HttpRequest 
72+         ** kwargs : Any 
73+     ) ->  HttpResponse :
8274        """Runs the network request through the client's chained policies. 
8375
84-         :param http_request: The network request you want to make. Required. 
85-         :type http_request: ~azure.core.pipeline.transport.HttpRequest 
86-         :keyword bool stream: Whether the response payload will be streamed. Defaults to True. 
76+         >>> from azure.core.rest import HttpRequest 
77+         >>> request = HttpRequest("GET", "https://www.example.org/") 
78+         <HttpRequest [GET], url: 'https://www.example.org/'> 
79+         >>> response = client._send_request(request) 
80+         <HttpResponse: 200 OK> 
81+ 
82+         For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart 
83+ 
84+         :param request: The network request you want to make. Required. 
85+         :type request: ~azure.core.rest.HttpRequest 
86+         :keyword bool stream: Whether the response payload will be streamed. Defaults to False. 
8787        :return: The response of your network call. Does not do error handling on your response. 
88-         :rtype: ~azure.core.pipeline.transport .HttpResponse 
88+         :rtype: ~azure.core.rest .HttpResponse 
8989        """ 
90-         path_format_arguments  =  {
91-             'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
92-         }
93-         http_request .url  =  self ._client .format_url (http_request .url , ** path_format_arguments )
94-         stream  =  kwargs .pop ("stream" , True )
95-         pipeline_response  =  self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
96-         return  pipeline_response .http_response 
90+ 
91+         request_copy  =  deepcopy (request )
92+         request_copy .url  =  self ._client .format_url (request_copy .url )
93+         return  self ._client .send_request (request_copy , ** kwargs )
9794
9895    def  close (self ):
9996        # type: () -> None 
0 commit comments