10
10
# --------------------------------------------------------------------------
11
11
12
12
from typing import Any , Optional , TYPE_CHECKING
13
+ from typing_extensions import Self
13
14
15
+ from azure .core .pipeline import policies
14
16
from azure .mgmt .core import ARMPipelineClient
17
+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
15
18
from azure .profiles import KnownProfiles , ProfileDefinition
16
19
from azure .profiles .multiapiclient import MultiApiClientMixin
17
20
@@ -53,7 +56,7 @@ class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
53
56
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
54
57
"""
55
58
56
- DEFAULT_API_VERSION = '2023-09-04 '
59
+ DEFAULT_API_VERSION = '2023-11-22 '
57
60
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient"
58
61
LATEST_PROFILE = ProfileDefinition ({
59
62
_PROFILE_TAG : {
@@ -74,7 +77,25 @@ def __init__(
74
77
if api_version :
75
78
kwargs .setdefault ('api_version' , api_version )
76
79
self ._config = AzureRedHatOpenShiftClientConfiguration (credential , subscription_id , ** kwargs )
77
- self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
80
+ _policies = kwargs .pop ("policies" , None )
81
+ if _policies is None :
82
+ _policies = [
83
+ policies .RequestIdPolicy (** kwargs ),
84
+ self ._config .headers_policy ,
85
+ self ._config .user_agent_policy ,
86
+ self ._config .proxy_policy ,
87
+ policies .ContentDecodePolicy (** kwargs ),
88
+ ARMAutoResourceProviderRegistrationPolicy (),
89
+ self ._config .redirect_policy ,
90
+ self ._config .retry_policy ,
91
+ self ._config .authentication_policy ,
92
+ self ._config .custom_hook_policy ,
93
+ self ._config .logging_policy ,
94
+ policies .DistributedTracingPolicy (** kwargs ),
95
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
96
+ self ._config .http_logging_policy ,
97
+ ]
98
+ self ._client = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
78
99
super (AzureRedHatOpenShiftClient , self ).__init__ (
79
100
api_version = api_version ,
80
101
profile = profile
@@ -94,6 +115,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
94
115
* 2022-09-04: :mod:`v2022_09_04.models<azure.mgmt.redhatopenshift.v2022_09_04.models>`
95
116
* 2023-04-01: :mod:`v2023_04_01.models<azure.mgmt.redhatopenshift.v2023_04_01.models>`
96
117
* 2023-09-04: :mod:`v2023_09_04.models<azure.mgmt.redhatopenshift.v2023_09_04.models>`
118
+ * 2023-11-22: :mod:`v2023_11_22.models<azure.mgmt.redhatopenshift.v2023_11_22.models>`
97
119
"""
98
120
if api_version == '2020-04-30' :
99
121
from .v2020_04_30 import models
@@ -113,6 +135,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
113
135
elif api_version == '2023-09-04' :
114
136
from .v2023_09_04 import models
115
137
return models
138
+ elif api_version == '2023-11-22' :
139
+ from .v2023_11_22 import models
140
+ return models
116
141
raise ValueError ("API version {} is not available" .format (api_version ))
117
142
118
143
@property
@@ -122,6 +147,7 @@ def machine_pools(self):
122
147
* 2022-09-04: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.MachinePoolsOperations>`
123
148
* 2023-04-01: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.MachinePoolsOperations>`
124
149
* 2023-09-04: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.MachinePoolsOperations>`
150
+ * 2023-11-22: :class:`MachinePoolsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.MachinePoolsOperations>`
125
151
"""
126
152
api_version = self ._get_api_version ('machine_pools' )
127
153
if api_version == '2022-09-04' :
@@ -130,6 +156,8 @@ def machine_pools(self):
130
156
from .v2023_04_01 .operations import MachinePoolsOperations as OperationClass
131
157
elif api_version == '2023-09-04' :
132
158
from .v2023_09_04 .operations import MachinePoolsOperations as OperationClass
159
+ elif api_version == '2023-11-22' :
160
+ from .v2023_11_22 .operations import MachinePoolsOperations as OperationClass
133
161
else :
134
162
raise ValueError ("API version {} does not have operation group 'machine_pools'" .format (api_version ))
135
163
self ._config .api_version = api_version
@@ -145,6 +173,7 @@ def open_shift_clusters(self):
145
173
* 2022-09-04: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftClustersOperations>`
146
174
* 2023-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.OpenShiftClustersOperations>`
147
175
* 2023-09-04: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.OpenShiftClustersOperations>`
176
+ * 2023-11-22: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.OpenShiftClustersOperations>`
148
177
"""
149
178
api_version = self ._get_api_version ('open_shift_clusters' )
150
179
if api_version == '2020-04-30' :
@@ -159,6 +188,8 @@ def open_shift_clusters(self):
159
188
from .v2023_04_01 .operations import OpenShiftClustersOperations as OperationClass
160
189
elif api_version == '2023-09-04' :
161
190
from .v2023_09_04 .operations import OpenShiftClustersOperations as OperationClass
191
+ elif api_version == '2023-11-22' :
192
+ from .v2023_11_22 .operations import OpenShiftClustersOperations as OperationClass
162
193
else :
163
194
raise ValueError ("API version {} does not have operation group 'open_shift_clusters'" .format (api_version ))
164
195
self ._config .api_version = api_version
@@ -171,6 +202,7 @@ def open_shift_versions(self):
171
202
* 2022-09-04: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftVersionsOperations>`
172
203
* 2023-04-01: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.OpenShiftVersionsOperations>`
173
204
* 2023-09-04: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.OpenShiftVersionsOperations>`
205
+ * 2023-11-22: :class:`OpenShiftVersionsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.OpenShiftVersionsOperations>`
174
206
"""
175
207
api_version = self ._get_api_version ('open_shift_versions' )
176
208
if api_version == '2022-09-04' :
@@ -179,6 +211,8 @@ def open_shift_versions(self):
179
211
from .v2023_04_01 .operations import OpenShiftVersionsOperations as OperationClass
180
212
elif api_version == '2023-09-04' :
181
213
from .v2023_09_04 .operations import OpenShiftVersionsOperations as OperationClass
214
+ elif api_version == '2023-11-22' :
215
+ from .v2023_11_22 .operations import OpenShiftVersionsOperations as OperationClass
182
216
else :
183
217
raise ValueError ("API version {} does not have operation group 'open_shift_versions'" .format (api_version ))
184
218
self ._config .api_version = api_version
@@ -194,6 +228,7 @@ def operations(self):
194
228
* 2022-09-04: :class:`Operations<azure.mgmt.redhatopenshift.v2022_09_04.operations.Operations>`
195
229
* 2023-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2023_04_01.operations.Operations>`
196
230
* 2023-09-04: :class:`Operations<azure.mgmt.redhatopenshift.v2023_09_04.operations.Operations>`
231
+ * 2023-11-22: :class:`Operations<azure.mgmt.redhatopenshift.v2023_11_22.operations.Operations>`
197
232
"""
198
233
api_version = self ._get_api_version ('operations' )
199
234
if api_version == '2020-04-30' :
@@ -208,6 +243,8 @@ def operations(self):
208
243
from .v2023_04_01 .operations import Operations as OperationClass
209
244
elif api_version == '2023-09-04' :
210
245
from .v2023_09_04 .operations import Operations as OperationClass
246
+ elif api_version == '2023-11-22' :
247
+ from .v2023_11_22 .operations import Operations as OperationClass
211
248
else :
212
249
raise ValueError ("API version {} does not have operation group 'operations'" .format (api_version ))
213
250
self ._config .api_version = api_version
@@ -220,6 +257,7 @@ def secrets(self):
220
257
* 2022-09-04: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.SecretsOperations>`
221
258
* 2023-04-01: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.SecretsOperations>`
222
259
* 2023-09-04: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.SecretsOperations>`
260
+ * 2023-11-22: :class:`SecretsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.SecretsOperations>`
223
261
"""
224
262
api_version = self ._get_api_version ('secrets' )
225
263
if api_version == '2022-09-04' :
@@ -228,6 +266,8 @@ def secrets(self):
228
266
from .v2023_04_01 .operations import SecretsOperations as OperationClass
229
267
elif api_version == '2023-09-04' :
230
268
from .v2023_09_04 .operations import SecretsOperations as OperationClass
269
+ elif api_version == '2023-11-22' :
270
+ from .v2023_11_22 .operations import SecretsOperations as OperationClass
231
271
else :
232
272
raise ValueError ("API version {} does not have operation group 'secrets'" .format (api_version ))
233
273
self ._config .api_version = api_version
@@ -240,6 +280,7 @@ def sync_identity_providers(self):
240
280
* 2022-09-04: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.SyncIdentityProvidersOperations>`
241
281
* 2023-04-01: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.SyncIdentityProvidersOperations>`
242
282
* 2023-09-04: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.SyncIdentityProvidersOperations>`
283
+ * 2023-11-22: :class:`SyncIdentityProvidersOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.SyncIdentityProvidersOperations>`
243
284
"""
244
285
api_version = self ._get_api_version ('sync_identity_providers' )
245
286
if api_version == '2022-09-04' :
@@ -248,6 +289,8 @@ def sync_identity_providers(self):
248
289
from .v2023_04_01 .operations import SyncIdentityProvidersOperations as OperationClass
249
290
elif api_version == '2023-09-04' :
250
291
from .v2023_09_04 .operations import SyncIdentityProvidersOperations as OperationClass
292
+ elif api_version == '2023-11-22' :
293
+ from .v2023_11_22 .operations import SyncIdentityProvidersOperations as OperationClass
251
294
else :
252
295
raise ValueError ("API version {} does not have operation group 'sync_identity_providers'" .format (api_version ))
253
296
self ._config .api_version = api_version
@@ -260,6 +303,7 @@ def sync_sets(self):
260
303
* 2022-09-04: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2022_09_04.operations.SyncSetsOperations>`
261
304
* 2023-04-01: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_04_01.operations.SyncSetsOperations>`
262
305
* 2023-09-04: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_09_04.operations.SyncSetsOperations>`
306
+ * 2023-11-22: :class:`SyncSetsOperations<azure.mgmt.redhatopenshift.v2023_11_22.operations.SyncSetsOperations>`
263
307
"""
264
308
api_version = self ._get_api_version ('sync_sets' )
265
309
if api_version == '2022-09-04' :
@@ -268,6 +312,8 @@ def sync_sets(self):
268
312
from .v2023_04_01 .operations import SyncSetsOperations as OperationClass
269
313
elif api_version == '2023-09-04' :
270
314
from .v2023_09_04 .operations import SyncSetsOperations as OperationClass
315
+ elif api_version == '2023-11-22' :
316
+ from .v2023_11_22 .operations import SyncSetsOperations as OperationClass
271
317
else :
272
318
raise ValueError ("API version {} does not have operation group 'sync_sets'" .format (api_version ))
273
319
self ._config .api_version = api_version
0 commit comments