88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
13+ from azure .core .pipeline import policies
1214from azure .core .rest import HttpRequest , HttpResponse
1315from azure .mgmt .core import ARMPipelineClient
16+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1417
1518from . import models as _models
1619from ._configuration import AzureStackHCIClientConfiguration
1720from ._serialization import Deserializer , Serializer
1821from .operations import (
19- GalleryImagesOperations ,
20- GuestAgentOperations ,
21- GuestAgentsOperations ,
22- HybridIdentityMetadataOperations ,
23- LogicalNetworksOperations ,
24- MarketplaceGalleryImagesOperations ,
25- NetworkInterfacesOperations ,
22+ ArcSettingsOperations ,
23+ ClustersOperations ,
24+ DeploymentSettingsOperations ,
25+ EdgeDevicesOperations ,
26+ ExtensionsOperations ,
27+ OffersOperations ,
2628 Operations ,
27- StorageContainersOperations ,
28- VirtualHardDisksOperations ,
29- VirtualMachineInstancesOperations ,
29+ PublishersOperations ,
30+ SecuritySettingsOperations ,
31+ SkusOperations ,
32+ UpdateRunsOperations ,
33+ UpdateSummariesOperations ,
34+ UpdatesOperations ,
3035)
3136
3237if TYPE_CHECKING :
3742class AzureStackHCIClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3843 """Azure Stack HCI management service.
3944
40- :ivar gallery_images: GalleryImagesOperations operations
41- :vartype gallery_images: azure.mgmt.azurestackhci.operations.GalleryImagesOperations
45+ :ivar arc_settings: ArcSettingsOperations operations
46+ :vartype arc_settings: azure.mgmt.azurestackhci.operations.ArcSettingsOperations
47+ :ivar clusters: ClustersOperations operations
48+ :vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations
49+ :ivar deployment_settings: DeploymentSettingsOperations operations
50+ :vartype deployment_settings: azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations
51+ :ivar edge_devices: EdgeDevicesOperations operations
52+ :vartype edge_devices: azure.mgmt.azurestackhci.operations.EdgeDevicesOperations
53+ :ivar extensions: ExtensionsOperations operations
54+ :vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations
55+ :ivar offers: OffersOperations operations
56+ :vartype offers: azure.mgmt.azurestackhci.operations.OffersOperations
4257 :ivar operations: Operations operations
4358 :vartype operations: azure.mgmt.azurestackhci.operations.Operations
44- :ivar logical_networks: LogicalNetworksOperations operations
45- :vartype logical_networks: azure.mgmt.azurestackhci.operations.LogicalNetworksOperations
46- :ivar marketplace_gallery_images: MarketplaceGalleryImagesOperations operations
47- :vartype marketplace_gallery_images:
48- azure.mgmt.azurestackhci.operations.MarketplaceGalleryImagesOperations
49- :ivar network_interfaces: NetworkInterfacesOperations operations
50- :vartype network_interfaces: azure.mgmt.azurestackhci.operations.NetworkInterfacesOperations
51- :ivar storage_containers: StorageContainersOperations operations
52- :vartype storage_containers: azure.mgmt.azurestackhci.operations.StorageContainersOperations
53- :ivar virtual_hard_disks: VirtualHardDisksOperations operations
54- :vartype virtual_hard_disks: azure.mgmt.azurestackhci.operations.VirtualHardDisksOperations
55- :ivar virtual_machine_instances: VirtualMachineInstancesOperations operations
56- :vartype virtual_machine_instances:
57- azure.mgmt.azurestackhci.operations.VirtualMachineInstancesOperations
58- :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations
59- :vartype hybrid_identity_metadata:
60- azure.mgmt.azurestackhci.operations.HybridIdentityMetadataOperations
61- :ivar guest_agent: GuestAgentOperations operations
62- :vartype guest_agent: azure.mgmt.azurestackhci.operations.GuestAgentOperations
63- :ivar guest_agents: GuestAgentsOperations operations
64- :vartype guest_agents: azure.mgmt.azurestackhci.operations.GuestAgentsOperations
59+ :ivar publishers: PublishersOperations operations
60+ :vartype publishers: azure.mgmt.azurestackhci.operations.PublishersOperations
61+ :ivar security_settings: SecuritySettingsOperations operations
62+ :vartype security_settings: azure.mgmt.azurestackhci.operations.SecuritySettingsOperations
63+ :ivar skus: SkusOperations operations
64+ :vartype skus: azure.mgmt.azurestackhci.operations.SkusOperations
65+ :ivar update_runs: UpdateRunsOperations operations
66+ :vartype update_runs: azure.mgmt.azurestackhci.operations.UpdateRunsOperations
67+ :ivar update_summaries: UpdateSummariesOperations operations
68+ :vartype update_summaries: azure.mgmt.azurestackhci.operations.UpdateSummariesOperations
69+ :ivar updates: UpdatesOperations operations
70+ :vartype updates: azure.mgmt.azurestackhci.operations.UpdatesOperations
6571 :param credential: Credential needed for the client to connect to Azure. Required.
6672 :type credential: ~azure.core.credentials.TokenCredential
67- :param subscription_id: The ID of the target subscription. Required.
73+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
6874 :type subscription_id: str
6975 :param base_url: Service URL. Default value is "https://management.azure.com".
7076 :type base_url: str
71- :keyword api_version: Api Version. Default value is "2023-09 -01-preview ". Note that overriding
72- this default value may result in unsupported behavior.
77+ :keyword api_version: Api Version. Default value is "2024-04 -01". Note that overriding this
78+ default value may result in unsupported behavior.
7379 :paramtype api_version: str
7480 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
7581 Retry-After header is present.
@@ -85,39 +91,51 @@ def __init__(
8591 self ._config = AzureStackHCIClientConfiguration (
8692 credential = credential , subscription_id = subscription_id , ** kwargs
8793 )
88- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
94+ _policies = kwargs .pop ("policies" , None )
95+ if _policies is None :
96+ _policies = [
97+ policies .RequestIdPolicy (** kwargs ),
98+ self ._config .headers_policy ,
99+ self ._config .user_agent_policy ,
100+ self ._config .proxy_policy ,
101+ policies .ContentDecodePolicy (** kwargs ),
102+ ARMAutoResourceProviderRegistrationPolicy (),
103+ self ._config .redirect_policy ,
104+ self ._config .retry_policy ,
105+ self ._config .authentication_policy ,
106+ self ._config .custom_hook_policy ,
107+ self ._config .logging_policy ,
108+ policies .DistributedTracingPolicy (** kwargs ),
109+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
110+ self ._config .http_logging_policy ,
111+ ]
112+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
89113
90114 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
91115 self ._serialize = Serializer (client_models )
92116 self ._deserialize = Deserializer (client_models )
93117 self ._serialize .client_side_validation = False
94- self .gallery_images = GalleryImagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
95- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
96- self .logical_networks = LogicalNetworksOperations (
97- self ._client , self ._config , self ._serialize , self ._deserialize
98- )
99- self .marketplace_gallery_images = MarketplaceGalleryImagesOperations (
100- self ._client , self ._config , self ._serialize , self ._deserialize
101- )
102- self .network_interfaces = NetworkInterfacesOperations (
118+ self .arc_settings = ArcSettingsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119+ self .clusters = ClustersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
120+ self .deployment_settings = DeploymentSettingsOperations (
103121 self ._client , self ._config , self ._serialize , self ._deserialize
104122 )
105- self .storage_containers = StorageContainersOperations (
106- self ._client , self ._config , self ._serialize , self ._deserialize
107- )
108- self .virtual_hard_disks = VirtualHardDisksOperations (
109- self ._client , self ._config , self ._serialize , self ._deserialize
110- )
111- self .virtual_machine_instances = VirtualMachineInstancesOperations (
123+ self .edge_devices = EdgeDevicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
124+ self .extensions = ExtensionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
125+ self .offers = OffersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
126+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
127+ self .publishers = PublishersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
128+ self .security_settings = SecuritySettingsOperations (
112129 self ._client , self ._config , self ._serialize , self ._deserialize
113130 )
114- self .hybrid_identity_metadata = HybridIdentityMetadataOperations (
131+ self .skus = SkusOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
132+ self .update_runs = UpdateRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
133+ self .update_summaries = UpdateSummariesOperations (
115134 self ._client , self ._config , self ._serialize , self ._deserialize
116135 )
117- self .guest_agent = GuestAgentOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118- self .guest_agents = GuestAgentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
136+ self .updates = UpdatesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119137
120- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
138+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
121139 """Runs the network request through the client's chained policies.
122140
123141 >>> from azure.core.rest import HttpRequest
@@ -137,12 +155,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
137155
138156 request_copy = deepcopy (request )
139157 request_copy .url = self ._client .format_url (request_copy .url )
140- return self ._client .send_request (request_copy , ** kwargs )
158+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
141159
142160 def close (self ) -> None :
143161 self ._client .close ()
144162
145- def __enter__ (self ) -> "AzureStackHCIClient" :
163+ def __enter__ (self ) -> Self :
146164 self ._client .__enter__ ()
147165 return self
148166
0 commit comments