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 MicrosoftStorageSyncConfiguration
18+ from .operations import CloudEndpointsOperations , MicrosoftStorageSyncOperationsMixin , OperationStatusOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations , RegisteredServersOperations , ServerEndpointsOperations , StorageSyncServicesOperations , SyncGroupsOperations , WorkflowsOperations
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
1923
20- from ._configuration import MicrosoftStorageSyncConfiguration
21- from .operations import Operations
22- from .operations import StorageSyncServicesOperations
23- from .operations import PrivateLinkResourcesOperations
24- from .operations import PrivateEndpointConnectionsOperations
25- from .operations import SyncGroupsOperations
26- from .operations import CloudEndpointsOperations
27- from .operations import ServerEndpointsOperations
28- from .operations import RegisteredServersOperations
29- from .operations import WorkflowsOperations
30- from .operations import OperationStatusOperations
31- from . import models
32-
33-
34- class MicrosoftStorageSync (object ):
24+ class MicrosoftStorageSync (MicrosoftStorageSyncOperationsMixin ):
3525 """Microsoft Storage Sync Service API.
3626
3727 :ivar operations: Operations operations
3828 :vartype operations: azure.mgmt.storagesync.operations.Operations
3929 :ivar storage_sync_services: StorageSyncServicesOperations operations
4030 :vartype storage_sync_services: azure.mgmt.storagesync.operations.StorageSyncServicesOperations
4131 :ivar private_link_resources: PrivateLinkResourcesOperations operations
42- :vartype private_link_resources: azure.mgmt.storagesync.operations.PrivateLinkResourcesOperations
32+ :vartype private_link_resources:
33+ azure.mgmt.storagesync.operations.PrivateLinkResourcesOperations
4334 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
44- :vartype private_endpoint_connections: azure.mgmt.storagesync.operations.PrivateEndpointConnectionsOperations
35+ :vartype private_endpoint_connections:
36+ azure.mgmt.storagesync.operations.PrivateEndpointConnectionsOperations
4537 :ivar sync_groups: SyncGroupsOperations operations
4638 :vartype sync_groups: azure.mgmt.storagesync.operations.SyncGroupsOperations
4739 :ivar cloud_endpoints: CloudEndpointsOperations operations
@@ -58,48 +50,63 @@ class MicrosoftStorageSync(object):
5850 :type credential: ~azure.core.credentials.TokenCredential
5951 :param subscription_id: The ID of the target subscription.
6052 :type subscription_id: str
61- :param str base_url: Service URL
62- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
53+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
54+ :type base_url: str
55+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
56+ Retry-After header is present.
6357 """
6458
6559 def __init__ (
6660 self ,
67- credential , # type: "TokenCredential"
68- subscription_id , # type: str
69- base_url = None , # type: Optional[str]
70- ** kwargs # type: Any
71- ):
72- # type: (...) -> None
73- if not base_url :
74- base_url = 'https://management.azure.com'
75- self ._config = MicrosoftStorageSyncConfiguration (credential , subscription_id , ** kwargs )
61+ credential : "TokenCredential" ,
62+ subscription_id : str ,
63+ base_url : str = "https://management.azure.com" ,
64+ ** kwargs : Any
65+ ) -> None :
66+ self ._config = MicrosoftStorageSyncConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
7667 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
7768
7869 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
7970 self ._serialize = Serializer (client_models )
80- self ._serialize .client_side_validation = False
8171 self ._deserialize = Deserializer (client_models )
72+ self ._serialize .client_side_validation = False
73+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
74+ self .storage_sync_services = StorageSyncServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
75+ self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
76+ self .private_endpoint_connections = PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
77+ self .sync_groups = SyncGroupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
78+ self .cloud_endpoints = CloudEndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
79+ self .server_endpoints = ServerEndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
80+ self .registered_servers = RegisteredServersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
81+ self .workflows = WorkflowsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
82+ self .operation_status = OperationStatusOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
83+
84+
85+ def _send_request (
86+ self ,
87+ request , # type: HttpRequest
88+ ** kwargs : Any
89+ ) -> HttpResponse :
90+ """Runs the network request through the client's chained policies.
91+
92+ >>> from azure.core.rest import HttpRequest
93+ >>> request = HttpRequest("GET", "https://www.example.org/")
94+ <HttpRequest [GET], url: 'https://www.example.org/'>
95+ >>> response = client._send_request(request)
96+ <HttpResponse: 200 OK>
97+
98+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
99+
100+ :param request: The network request you want to make. Required.
101+ :type request: ~azure.core.rest.HttpRequest
102+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
103+ :return: The response of your network call. Does not do error handling on your response.
104+ :rtype: ~azure.core.rest.HttpResponse
105+ """
82106
83- self .operations = Operations (
84- self ._client , self ._config , self ._serialize , self ._deserialize )
85- self .storage_sync_services = StorageSyncServicesOperations (
86- self ._client , self ._config , self ._serialize , self ._deserialize )
87- self .private_link_resources = PrivateLinkResourcesOperations (
88- self ._client , self ._config , self ._serialize , self ._deserialize )
89- self .private_endpoint_connections = PrivateEndpointConnectionsOperations (
90- self ._client , self ._config , self ._serialize , self ._deserialize )
91- self .sync_groups = SyncGroupsOperations (
92- self ._client , self ._config , self ._serialize , self ._deserialize )
93- self .cloud_endpoints = CloudEndpointsOperations (
94- self ._client , self ._config , self ._serialize , self ._deserialize )
95- self .server_endpoints = ServerEndpointsOperations (
96- self ._client , self ._config , self ._serialize , self ._deserialize )
97- self .registered_servers = RegisteredServersOperations (
98- self ._client , self ._config , self ._serialize , self ._deserialize )
99- self .workflows = WorkflowsOperations (
100- self ._client , self ._config , self ._serialize , self ._deserialize )
101- self .operation_status = OperationStatusOperations (
102- self ._client , self ._config , self ._serialize , self ._deserialize )
107+ request_copy = deepcopy (request )
108+ request_copy .url = self ._client .format_url (request_copy .url )
109+ return self ._client .send_request (request_copy , ** kwargs )
103110
104111 def close (self ):
105112 # type: () -> None
0 commit comments