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 DevCenterMgmtClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
19
21
AttachedNetworksOperations ,
20
- CatalogDevBoxDefinitionsOperations ,
21
22
CatalogsOperations ,
22
23
CheckNameAvailabilityOperations ,
23
- CustomizationTasksOperations ,
24
+ CheckScopedNameAvailabilityOperations ,
24
25
DevBoxDefinitionsOperations ,
25
26
DevCentersOperations ,
26
27
EnvironmentDefinitionsOperations ,
33
34
Operations ,
34
35
PoolsOperations ,
35
36
ProjectAllowedEnvironmentTypesOperations ,
37
+ ProjectCatalogEnvironmentDefinitionsOperations ,
38
+ ProjectCatalogsOperations ,
36
39
ProjectEnvironmentTypesOperations ,
37
40
ProjectsOperations ,
38
41
SchedulesOperations ,
@@ -54,6 +57,15 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
54
57
:vartype projects: azure.mgmt.devcenter.operations.ProjectsOperations
55
58
:ivar attached_networks: AttachedNetworksOperations operations
56
59
:vartype attached_networks: azure.mgmt.devcenter.operations.AttachedNetworksOperations
60
+ :ivar project_catalogs: ProjectCatalogsOperations operations
61
+ :vartype project_catalogs: azure.mgmt.devcenter.operations.ProjectCatalogsOperations
62
+ :ivar environment_definitions: EnvironmentDefinitionsOperations operations
63
+ :vartype environment_definitions:
64
+ azure.mgmt.devcenter.operations.EnvironmentDefinitionsOperations
65
+ :ivar project_catalog_environment_definitions: ProjectCatalogEnvironmentDefinitionsOperations
66
+ operations
67
+ :vartype project_catalog_environment_definitions:
68
+ azure.mgmt.devcenter.operations.ProjectCatalogEnvironmentDefinitionsOperations
57
69
:ivar galleries: GalleriesOperations operations
58
70
:vartype galleries: azure.mgmt.devcenter.operations.GalleriesOperations
59
71
:ivar images: ImagesOperations operations
@@ -81,14 +93,9 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
81
93
:ivar check_name_availability: CheckNameAvailabilityOperations operations
82
94
:vartype check_name_availability:
83
95
azure.mgmt.devcenter.operations.CheckNameAvailabilityOperations
84
- :ivar catalog_dev_box_definitions: CatalogDevBoxDefinitionsOperations operations
85
- :vartype catalog_dev_box_definitions:
86
- azure.mgmt.devcenter.operations.CatalogDevBoxDefinitionsOperations
87
- :ivar customization_tasks: CustomizationTasksOperations operations
88
- :vartype customization_tasks: azure.mgmt.devcenter.operations.CustomizationTasksOperations
89
- :ivar environment_definitions: EnvironmentDefinitionsOperations operations
90
- :vartype environment_definitions:
91
- azure.mgmt.devcenter.operations.EnvironmentDefinitionsOperations
96
+ :ivar check_scoped_name_availability: CheckScopedNameAvailabilityOperations operations
97
+ :vartype check_scoped_name_availability:
98
+ azure.mgmt.devcenter.operations.CheckScopedNameAvailabilityOperations
92
99
:ivar skus: SkusOperations operations
93
100
:vartype skus: azure.mgmt.devcenter.operations.SkusOperations
94
101
:ivar pools: PoolsOperations operations
@@ -103,8 +110,8 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
103
110
:type subscription_id: str
104
111
:param base_url: Service URL. Default value is "https://management.azure.com".
105
112
:type base_url: str
106
- :keyword api_version: Api Version. Default value is "2023-10 -01-preview ". Note that overriding
107
- this default value may result in unsupported behavior.
113
+ :keyword api_version: Api Version. Default value is "2024-02 -01". Note that overriding this
114
+ default value may result in unsupported behavior.
108
115
:paramtype api_version: str
109
116
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
110
117
Retry-After header is present.
@@ -120,7 +127,25 @@ def __init__(
120
127
self ._config = DevCenterMgmtClientConfiguration (
121
128
credential = credential , subscription_id = subscription_id , ** kwargs
122
129
)
123
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
130
+ _policies = kwargs .pop ("policies" , None )
131
+ if _policies is None :
132
+ _policies = [
133
+ policies .RequestIdPolicy (** kwargs ),
134
+ self ._config .headers_policy ,
135
+ self ._config .user_agent_policy ,
136
+ self ._config .proxy_policy ,
137
+ policies .ContentDecodePolicy (** kwargs ),
138
+ ARMAutoResourceProviderRegistrationPolicy (),
139
+ self ._config .redirect_policy ,
140
+ self ._config .retry_policy ,
141
+ self ._config .authentication_policy ,
142
+ self ._config .custom_hook_policy ,
143
+ self ._config .logging_policy ,
144
+ policies .DistributedTracingPolicy (** kwargs ),
145
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
146
+ self ._config .http_logging_policy ,
147
+ ]
148
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
124
149
125
150
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
126
151
self ._serialize = Serializer (client_models )
@@ -131,6 +156,15 @@ def __init__(
131
156
self .attached_networks = AttachedNetworksOperations (
132
157
self ._client , self ._config , self ._serialize , self ._deserialize
133
158
)
159
+ self .project_catalogs = ProjectCatalogsOperations (
160
+ self ._client , self ._config , self ._serialize , self ._deserialize
161
+ )
162
+ self .environment_definitions = EnvironmentDefinitionsOperations (
163
+ self ._client , self ._config , self ._serialize , self ._deserialize
164
+ )
165
+ self .project_catalog_environment_definitions = ProjectCatalogEnvironmentDefinitionsOperations (
166
+ self ._client , self ._config , self ._serialize , self ._deserialize
167
+ )
134
168
self .galleries = GalleriesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
135
169
self .images = ImagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
136
170
self .image_versions = ImageVersionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
@@ -155,13 +189,7 @@ def __init__(
155
189
self .check_name_availability = CheckNameAvailabilityOperations (
156
190
self ._client , self ._config , self ._serialize , self ._deserialize
157
191
)
158
- self .catalog_dev_box_definitions = CatalogDevBoxDefinitionsOperations (
159
- self ._client , self ._config , self ._serialize , self ._deserialize
160
- )
161
- self .customization_tasks = CustomizationTasksOperations (
162
- self ._client , self ._config , self ._serialize , self ._deserialize
163
- )
164
- self .environment_definitions = EnvironmentDefinitionsOperations (
192
+ self .check_scoped_name_availability = CheckScopedNameAvailabilityOperations (
165
193
self ._client , self ._config , self ._serialize , self ._deserialize
166
194
)
167
195
self .skus = SkusOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
@@ -171,7 +199,7 @@ def __init__(
171
199
self ._client , self ._config , self ._serialize , self ._deserialize
172
200
)
173
201
174
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
202
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
175
203
"""Runs the network request through the client's chained policies.
176
204
177
205
>>> from azure.core.rest import HttpRequest
@@ -191,7 +219,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
191
219
192
220
request_copy = deepcopy (request )
193
221
request_copy .url = self ._client .format_url (request_copy .url )
194
- return self ._client .send_request (request_copy , ** kwargs )
222
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
195
223
196
224
def close (self ) -> None :
197
225
self ._client .close ()
0 commit comments