9
9
from copy import deepcopy
10
10
from typing import Any , TYPE_CHECKING
11
11
12
+ from azure .core .pipeline import policies
12
13
from azure .core .rest import HttpRequest , HttpResponse
13
14
from azure .mgmt .core import ARMPipelineClient
15
+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
14
16
15
17
from . import models as _models
16
18
from ._configuration import DesktopVirtualizationMgmtClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
21
+ AppAttachPackageInfoOperations ,
22
+ AppAttachPackageOperations ,
19
23
ApplicationGroupsOperations ,
20
24
ApplicationsOperations ,
21
25
DesktopsOperations ,
@@ -77,15 +81,21 @@ class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-ver
77
81
:vartype session_hosts: azure.mgmt.desktopvirtualization.operations.SessionHostsOperations
78
82
:ivar msix_packages: MSIXPackagesOperations operations
79
83
:vartype msix_packages: azure.mgmt.desktopvirtualization.operations.MSIXPackagesOperations
84
+ :ivar app_attach_package_info: AppAttachPackageInfoOperations operations
85
+ :vartype app_attach_package_info:
86
+ azure.mgmt.desktopvirtualization.operations.AppAttachPackageInfoOperations
80
87
:ivar msix_images: MsixImagesOperations operations
81
88
:vartype msix_images: azure.mgmt.desktopvirtualization.operations.MsixImagesOperations
89
+ :ivar app_attach_package: AppAttachPackageOperations operations
90
+ :vartype app_attach_package:
91
+ azure.mgmt.desktopvirtualization.operations.AppAttachPackageOperations
82
92
:param credential: Credential needed for the client to connect to Azure. Required.
83
93
:type credential: ~azure.core.credentials.TokenCredential
84
- :param subscription_id: The ID of the target subscription. Required.
94
+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
85
95
:type subscription_id: str
86
96
:param base_url: Service URL. Default value is "https://management.azure.com".
87
97
:type base_url: str
88
- :keyword api_version: Api Version. Default value is "2023-09-05 ". Note that overriding this
98
+ :keyword api_version: Api Version. Default value is "2024-04-03 ". Note that overriding this
89
99
default value may result in unsupported behavior.
90
100
:paramtype api_version: str
91
101
"""
@@ -100,7 +110,25 @@ def __init__(
100
110
self ._config = DesktopVirtualizationMgmtClientConfiguration (
101
111
credential = credential , subscription_id = subscription_id , ** kwargs
102
112
)
103
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
113
+ _policies = kwargs .pop ("policies" , None )
114
+ if _policies is None :
115
+ _policies = [
116
+ policies .RequestIdPolicy (** kwargs ),
117
+ self ._config .headers_policy ,
118
+ self ._config .user_agent_policy ,
119
+ self ._config .proxy_policy ,
120
+ policies .ContentDecodePolicy (** kwargs ),
121
+ ARMAutoResourceProviderRegistrationPolicy (),
122
+ self ._config .redirect_policy ,
123
+ self ._config .retry_policy ,
124
+ self ._config .authentication_policy ,
125
+ self ._config .custom_hook_policy ,
126
+ self ._config .logging_policy ,
127
+ policies .DistributedTracingPolicy (** kwargs ),
128
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
129
+ self ._config .http_logging_policy ,
130
+ ]
131
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
104
132
105
133
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
106
134
self ._serialize = Serializer (client_models )
@@ -131,9 +159,15 @@ def __init__(
131
159
self .user_sessions = UserSessionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
132
160
self .session_hosts = SessionHostsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
133
161
self .msix_packages = MSIXPackagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
162
+ self .app_attach_package_info = AppAttachPackageInfoOperations (
163
+ self ._client , self ._config , self ._serialize , self ._deserialize
164
+ )
134
165
self .msix_images = MsixImagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
166
+ self .app_attach_package = AppAttachPackageOperations (
167
+ self ._client , self ._config , self ._serialize , self ._deserialize
168
+ )
135
169
136
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
170
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
137
171
"""Runs the network request through the client's chained policies.
138
172
139
173
>>> from azure.core.rest import HttpRequest
@@ -153,7 +187,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
153
187
154
188
request_copy = deepcopy (request )
155
189
request_copy .url = self ._client .format_url (request_copy .url )
156
- return self ._client .send_request (request_copy , ** kwargs )
190
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
157
191
158
192
def close (self ) -> None :
159
193
self ._client .close ()
0 commit comments