99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
1111
12+ from azure .core .pipeline import policies
1213from azure .core .rest import HttpRequest , HttpResponse
1314from azure .mgmt .core import ARMPipelineClient
15+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1416
1517from . import models as _models
1618from ._configuration import AVSClientConfiguration
2325 DatastoresOperations ,
2426 GlobalReachConnectionsOperations ,
2527 HcxEnterpriseSitesOperations ,
28+ IscsiPathsOperations ,
2629 LocationsOperations ,
2730 Operations ,
2831 PlacementPoliciesOperations ,
@@ -48,39 +51,41 @@ class AVSClient: # pylint: disable=client-accepts-api-version-keyword,too-many-
4851 :vartype locations: azure.mgmt.avs.operations.LocationsOperations
4952 :ivar private_clouds: PrivateCloudsOperations operations
5053 :vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations
51- :ivar clusters: ClustersOperations operations
52- :vartype clusters: azure.mgmt.avs.operations.ClustersOperations
53- :ivar datastores: DatastoresOperations operations
54- :vartype datastores: azure.mgmt.avs.operations.DatastoresOperations
55- :ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations
56- :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations
54+ :ivar addons: AddonsOperations operations
55+ :vartype addons: azure.mgmt.avs.operations.AddonsOperations
5756 :ivar authorizations: AuthorizationsOperations operations
5857 :vartype authorizations: azure.mgmt.avs.operations.AuthorizationsOperations
59- :ivar global_reach_connections: GlobalReachConnectionsOperations operations
60- :vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations
61- :ivar workload_networks: WorkloadNetworksOperations operations
62- :vartype workload_networks: azure.mgmt.avs.operations.WorkloadNetworksOperations
6358 :ivar cloud_links: CloudLinksOperations operations
6459 :vartype cloud_links: azure.mgmt.avs.operations.CloudLinksOperations
65- :ivar addons: AddonsOperations operations
66- :vartype addons : azure.mgmt.avs.operations.AddonsOperations
67- :ivar virtual_machines: VirtualMachinesOperations operations
68- :vartype virtual_machines : azure.mgmt.avs.operations.VirtualMachinesOperations
60+ :ivar clusters: ClustersOperations operations
61+ :vartype clusters : azure.mgmt.avs.operations.ClustersOperations
62+ :ivar datastores: DatastoresOperations operations
63+ :vartype datastores : azure.mgmt.avs.operations.DatastoresOperations
6964 :ivar placement_policies: PlacementPoliciesOperations operations
7065 :vartype placement_policies: azure.mgmt.avs.operations.PlacementPoliciesOperations
66+ :ivar virtual_machines: VirtualMachinesOperations operations
67+ :vartype virtual_machines: azure.mgmt.avs.operations.VirtualMachinesOperations
68+ :ivar global_reach_connections: GlobalReachConnectionsOperations operations
69+ :vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations
70+ :ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations
71+ :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations
72+ :ivar iscsi_paths: IscsiPathsOperations operations
73+ :vartype iscsi_paths: azure.mgmt.avs.operations.IscsiPathsOperations
74+ :ivar script_executions: ScriptExecutionsOperations operations
75+ :vartype script_executions: azure.mgmt.avs.operations.ScriptExecutionsOperations
7176 :ivar script_packages: ScriptPackagesOperations operations
7277 :vartype script_packages: azure.mgmt.avs.operations.ScriptPackagesOperations
7378 :ivar script_cmdlets: ScriptCmdletsOperations operations
7479 :vartype script_cmdlets: azure.mgmt.avs.operations.ScriptCmdletsOperations
75- :ivar script_executions: ScriptExecutionsOperations operations
76- :vartype script_executions : azure.mgmt.avs.operations.ScriptExecutionsOperations
80+ :ivar workload_networks: WorkloadNetworksOperations operations
81+ :vartype workload_networks : azure.mgmt.avs.operations.WorkloadNetworksOperations
7782 :param credential: Credential needed for the client to connect to Azure. Required.
7883 :type credential: ~azure.core.credentials.TokenCredential
79- :param subscription_id: The ID of the target subscription. Required.
84+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
8085 :type subscription_id: str
8186 :param base_url: Service URL. Default value is "https://management.azure.com".
8287 :type base_url: str
83- :keyword api_version: Api Version. Default value is "2023-03 -01". Note that overriding this
88+ :keyword api_version: Api Version. Default value is "2023-09 -01". Note that overriding this
8489 default value may result in unsupported behavior.
8590 :paramtype api_version: str
8691 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -95,7 +100,25 @@ def __init__(
95100 ** kwargs : Any
96101 ) -> None :
97102 self ._config = AVSClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
98- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
103+ _policies = kwargs .pop ("policies" , None )
104+ if _policies is None :
105+ _policies = [
106+ policies .RequestIdPolicy (** kwargs ),
107+ self ._config .headers_policy ,
108+ self ._config .user_agent_policy ,
109+ self ._config .proxy_policy ,
110+ policies .ContentDecodePolicy (** kwargs ),
111+ ARMAutoResourceProviderRegistrationPolicy (),
112+ self ._config .redirect_policy ,
113+ self ._config .retry_policy ,
114+ self ._config .authentication_policy ,
115+ self ._config .custom_hook_policy ,
116+ self ._config .logging_policy ,
117+ policies .DistributedTracingPolicy (** kwargs ),
118+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
119+ self ._config .http_logging_policy ,
120+ ]
121+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
99122
100123 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
101124 self ._serialize = Serializer (client_models )
@@ -104,33 +127,34 @@ def __init__(
104127 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
105128 self .locations = LocationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106129 self .private_clouds = PrivateCloudsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
130+ self .addons = AddonsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
131+ self .authorizations = AuthorizationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
132+ self .cloud_links = CloudLinksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
107133 self .clusters = ClustersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
108134 self .datastores = DatastoresOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
109- self .hcx_enterprise_sites = HcxEnterpriseSitesOperations (
135+ self .placement_policies = PlacementPoliciesOperations (
110136 self ._client , self ._config , self ._serialize , self ._deserialize
111137 )
112- self .authorizations = AuthorizationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
113- self .global_reach_connections = GlobalReachConnectionsOperations (
138+ self .virtual_machines = VirtualMachinesOperations (
114139 self ._client , self ._config , self ._serialize , self ._deserialize
115140 )
116- self .workload_networks = WorkloadNetworksOperations (
141+ self .global_reach_connections = GlobalReachConnectionsOperations (
117142 self ._client , self ._config , self ._serialize , self ._deserialize
118143 )
119- self .cloud_links = CloudLinksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
120- self .addons = AddonsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
121- self .virtual_machines = VirtualMachinesOperations (
144+ self .hcx_enterprise_sites = HcxEnterpriseSitesOperations (
122145 self ._client , self ._config , self ._serialize , self ._deserialize
123146 )
124- self .placement_policies = PlacementPoliciesOperations (
147+ self .iscsi_paths = IscsiPathsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
148+ self .script_executions = ScriptExecutionsOperations (
125149 self ._client , self ._config , self ._serialize , self ._deserialize
126150 )
127151 self .script_packages = ScriptPackagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
128152 self .script_cmdlets = ScriptCmdletsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
129- self .script_executions = ScriptExecutionsOperations (
153+ self .workload_networks = WorkloadNetworksOperations (
130154 self ._client , self ._config , self ._serialize , self ._deserialize
131155 )
132156
133- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
157+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
134158 """Runs the network request through the client's chained policies.
135159
136160 >>> from azure.core.rest import HttpRequest
@@ -150,7 +174,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
150174
151175 request_copy = deepcopy (request )
152176 request_copy .url = self ._client .format_url (request_copy .url )
153- return self ._client .send_request (request_copy , ** kwargs )
177+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
154178
155179 def close (self ) -> None :
156180 self ._client .close ()
0 commit comments