66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9+ from copy import deepcopy
910from typing import TYPE_CHECKING
1011
1112from azure .mgmt .core import ARMPipelineClient
1213from msrest import Deserializer , Serializer
1314
15+ from . import models
16+ from ._configuration import NetAppManagementClientConfiguration
17+ from .operations import AccountBackupsOperations , AccountsOperations , BackupPoliciesOperations , BackupsOperations , NetAppResourceOperations , NetAppResourceQuotaLimitsOperations , Operations , PoolsOperations , SnapshotPoliciesOperations , SnapshotsOperations , VaultsOperations , VolumeGroupsOperations , VolumesOperations
18+
1419if TYPE_CHECKING :
1520 # pylint: disable=unused-import,ungrouped-imports
1621 from typing import Any , Optional
1722
1823 from azure .core .credentials import TokenCredential
19- from azure .core .pipeline .transport import HttpRequest , HttpResponse
20-
21- from ._configuration import NetAppManagementClientConfiguration
22- from .operations import Operations
23- from .operations import NetAppResourceOperations
24- from .operations import NetAppResourceQuotaLimitsOperations
25- from .operations import AccountsOperations
26- from .operations import PoolsOperations
27- from .operations import VolumesOperations
28- from .operations import SnapshotsOperations
29- from .operations import SnapshotPoliciesOperations
30- from .operations import BackupsOperations
31- from .operations import AccountBackupsOperations
32- from .operations import BackupPoliciesOperations
33- from .operations import VaultsOperations
34- from . import models
35-
24+ from azure .core .rest import HttpRequest , HttpResponse
3625
3726class NetAppManagementClient (object ):
3827 """Microsoft NetApp Files Azure Resource Provider specification.
@@ -42,7 +31,8 @@ class NetAppManagementClient(object):
4231 :ivar net_app_resource: NetAppResourceOperations operations
4332 :vartype net_app_resource: azure.mgmt.netapp.operations.NetAppResourceOperations
4433 :ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations
45- :vartype net_app_resource_quota_limits: azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations
34+ :vartype net_app_resource_quota_limits:
35+ azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations
4636 :ivar accounts: AccountsOperations operations
4737 :vartype accounts: azure.mgmt.netapp.operations.AccountsOperations
4838 :ivar pools: PoolsOperations operations
@@ -61,74 +51,75 @@ class NetAppManagementClient(object):
6151 :vartype backup_policies: azure.mgmt.netapp.operations.BackupPoliciesOperations
6252 :ivar vaults: VaultsOperations operations
6353 :vartype vaults: azure.mgmt.netapp.operations.VaultsOperations
54+ :ivar volume_groups: VolumeGroupsOperations operations
55+ :vartype volume_groups: azure.mgmt.netapp.operations.VolumeGroupsOperations
6456 :param credential: Credential needed for the client to connect to Azure.
6557 :type credential: ~azure.core.credentials.TokenCredential
66- :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
58+ :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
59+ subscription. The subscription ID forms part of the URI for every service call.
6760 :type subscription_id: str
68- :param str base_url: Service URL
69- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
61+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
62+ :type base_url: str
63+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
64+ Retry-After header is present.
7065 """
7166
7267 def __init__ (
7368 self ,
7469 credential , # type: "TokenCredential"
7570 subscription_id , # type: str
76- base_url = None , # type: Optional[ str]
71+ base_url = "https://management.azure.com" , # type: str
7772 ** kwargs # type: Any
7873 ):
7974 # type: (...) -> None
80- if not base_url :
81- base_url = 'https://management.azure.com'
82- self ._config = NetAppManagementClientConfiguration (credential , subscription_id , ** kwargs )
75+ self ._config = NetAppManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
8376 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
8477
8578 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
8679 self ._serialize = Serializer (client_models )
87- self ._serialize .client_side_validation = False
8880 self ._deserialize = Deserializer (client_models )
89-
90- self .operations = Operations (
91- self ._client , self ._config , self ._serialize , self ._deserialize )
92- self .net_app_resource = NetAppResourceOperations (
93- self ._client , self ._config , self ._serialize , self ._deserialize )
94- self .net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations (
95- self ._client , self ._config , self ._serialize , self ._deserialize )
96- self .accounts = AccountsOperations (
97- self ._client , self ._config , self ._serialize , self ._deserialize )
98- self .pools = PoolsOperations (
99- self ._client , self ._config , self ._serialize , self ._deserialize )
100- self .volumes = VolumesOperations (
101- self ._client , self ._config , self ._serialize , self ._deserialize )
102- self .snapshots = SnapshotsOperations (
103- self ._client , self ._config , self ._serialize , self ._deserialize )
104- self .snapshot_policies = SnapshotPoliciesOperations (
105- self ._client , self ._config , self ._serialize , self ._deserialize )
106- self .backups = BackupsOperations (
107- self ._client , self ._config , self ._serialize , self ._deserialize )
108- self .account_backups = AccountBackupsOperations (
109- self ._client , self ._config , self ._serialize , self ._deserialize )
110- self .backup_policies = BackupPoliciesOperations (
111- self ._client , self ._config , self ._serialize , self ._deserialize )
112- self .vaults = VaultsOperations (
113- self ._client , self ._config , self ._serialize , self ._deserialize )
114-
115- def _send_request (self , http_request , ** kwargs ):
116- # type: (HttpRequest, Any) -> HttpResponse
81+ self ._serialize .client_side_validation = False
82+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
83+ self .net_app_resource = NetAppResourceOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
84+ self .net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
85+ self .accounts = AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
86+ self .pools = PoolsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
87+ self .volumes = VolumesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
88+ self .snapshots = SnapshotsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
89+ self .snapshot_policies = SnapshotPoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
90+ self .backups = BackupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
91+ self .account_backups = AccountBackupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
92+ self .backup_policies = BackupPoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
93+ self .vaults = VaultsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
94+ self .volume_groups = VolumeGroupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
95+
96+
97+ def _send_request (
98+ self ,
99+ request , # type: HttpRequest
100+ ** kwargs # type: Any
101+ ):
102+ # type: (...) -> HttpResponse
117103 """Runs the network request through the client's chained policies.
118104
119- :param http_request: The network request you want to make. Required.
120- :type http_request: ~azure.core.pipeline.transport.HttpRequest
121- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
105+ >>> from azure.core.rest import HttpRequest
106+ >>> request = HttpRequest("GET", "https://www.example.org/")
107+ <HttpRequest [GET], url: 'https://www.example.org/'>
108+ >>> response = client._send_request(request)
109+ <HttpResponse: 200 OK>
110+
111+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
112+
113+ :param request: The network request you want to make. Required.
114+ :type request: ~azure.core.rest.HttpRequest
115+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
122116 :return: The response of your network call. Does not do error handling on your response.
123- :rtype: ~azure.core.pipeline.transport .HttpResponse
117+ :rtype: ~azure.core.rest .HttpResponse
124118 """
125- path_format_arguments = {
126- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
127- }
128- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
129- stream = kwargs .pop ("stream" , True )
130- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
131- return pipeline_response .http_response
119+
120+ request_copy = deepcopy (request )
121+ request_copy .url = self ._client .format_url (request_copy .url )
122+ return self ._client .send_request (request_copy , ** kwargs )
132123
133124 def close (self ):
134125 # type: () -> None
0 commit comments