9
9
# regenerated.
10
10
# --------------------------------------------------------------------------
11
11
12
- from typing import Any , Optional , TYPE_CHECKING
12
+ from typing import Any , Optional , TYPE_CHECKING , cast
13
+ from typing_extensions import Self
13
14
14
15
from azure .core .pipeline import policies
16
+ from azure .core .settings import settings
15
17
from azure .mgmt .core import ARMPipelineClient
16
18
from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
19
+ from azure .mgmt .core .tools import get_arm_endpoints
17
20
from azure .profiles import KnownProfiles , ProfileDefinition
18
21
from azure .profiles .multiapiclient import MultiApiClientMixin
19
22
20
23
from ._configuration import SecurityCenterConfiguration
21
- from ._serialization import Deserializer , Serializer
24
+ from ._utils . serialization import Deserializer , Serializer
22
25
23
26
if TYPE_CHECKING :
24
27
# pylint: disable=unused-import,ungrouped-imports
25
28
from azure .core .credentials import TokenCredential
26
29
27
30
class _SDKClient (object ):
28
31
def __init__ (self , * args , ** kwargs ):
29
- """This is a fake class to support current implemetation of MultiApiClientMixin."
32
+ """This is a fake class to support current implementation of MultiApiClientMixin."
30
33
Will be removed in final version of multiapi azure-core based client
31
34
"""
32
35
pass
@@ -44,8 +47,6 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
44
47
45
48
:param credential: Credential needed for the client to connect to Azure. Required.
46
49
:type credential: ~azure.core.credentials.TokenCredential
47
- :param subscription_id: The ID of the target subscription. Required.
48
- :type subscription_id: str
49
50
:param api_version: API version to use if no profile is provided, or if missing in profile.
50
51
:type api_version: str
51
52
:param base_url: Service URL
@@ -55,13 +56,11 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
55
56
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
56
57
"""
57
58
58
- DEFAULT_API_VERSION = '2024-04 -01'
59
+ DEFAULT_API_VERSION = '2024-08 -01'
59
60
_PROFILE_TAG = "azure.mgmt.security.SecurityCenter"
60
61
LATEST_PROFILE = ProfileDefinition ({
61
62
_PROFILE_TAG : {
62
63
None : DEFAULT_API_VERSION ,
63
- 'adaptive_application_controls' : '2020-01-01' ,
64
- 'adaptive_network_hardenings' : '2020-01-01' ,
65
64
'advanced_threat_protection' : '2019-01-01' ,
66
65
'alerts' : '2022-01-01' ,
67
66
'alerts_suppression_rules' : '2019-01-01-preview' ,
@@ -76,15 +75,25 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
76
75
'assessments_metadata' : '2021-06-01' ,
77
76
'auto_provisioning_settings' : '2017-08-01-preview' ,
78
77
'automations' : '2019-01-01-preview' ,
78
+ 'azure_dev_ops_orgs' : '2024-04-01' ,
79
+ 'azure_dev_ops_projects' : '2024-04-01' ,
80
+ 'azure_dev_ops_repos' : '2024-04-01' ,
79
81
'compliance_results' : '2017-08-01' ,
80
82
'compliances' : '2017-08-01-preview' ,
81
83
'connectors' : '2020-01-01-preview' ,
82
84
'custom_assessment_automations' : '2021-07-01-preview' ,
83
85
'custom_entity_store_assignments' : '2021-07-01-preview' ,
84
86
'defender_for_storage' : '2022-12-01-preview' ,
87
+ 'dev_ops_configurations' : '2024-04-01' ,
88
+ 'dev_ops_operation_results' : '2024-04-01' ,
85
89
'device_security_groups' : '2019-08-01' ,
86
90
'discovered_security_solutions' : '2020-01-01' ,
87
91
'external_security_solutions' : '2020-01-01' ,
92
+ 'git_hub_owners' : '2024-04-01' ,
93
+ 'git_hub_repos' : '2024-04-01' ,
94
+ 'git_lab_groups' : '2024-04-01' ,
95
+ 'git_lab_projects' : '2024-04-01' ,
96
+ 'git_lab_subgroups' : '2024-04-01' ,
88
97
'governance_assignments' : '2022-01-01-preview' ,
89
98
'governance_rules' : '2022-01-01-preview' ,
90
99
'health_report' : '2023-02-01-preview' ,
@@ -131,15 +140,19 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
131
140
def __init__ (
132
141
self ,
133
142
credential : "TokenCredential" ,
134
- subscription_id : str ,
135
143
api_version : Optional [str ]= None ,
136
- base_url : str = "https://management.azure.com" ,
144
+ base_url : Optional [ str ] = None ,
137
145
profile : KnownProfiles = KnownProfiles .default ,
138
146
** kwargs : Any
139
147
):
140
148
if api_version :
141
149
kwargs .setdefault ('api_version' , api_version )
142
- self ._config = SecurityCenterConfiguration (credential , subscription_id , ** kwargs )
150
+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
151
+ _endpoints = get_arm_endpoints (_cloud )
152
+ if not base_url :
153
+ base_url = _endpoints ["resource_manager" ]
154
+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
155
+ self ._config = SecurityCenterConfiguration (credential , credential_scopes = credential_scopes , ** kwargs )
143
156
_policies = kwargs .pop ("policies" , None )
144
157
if _policies is None :
145
158
_policies = [
@@ -158,7 +171,7 @@ def __init__(
158
171
policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
159
172
self ._config .http_logging_policy ,
160
173
]
161
- self ._client = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
174
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
162
175
super (SecurityCenter , self ).__init__ (
163
176
api_version = api_version ,
164
177
profile = profile
@@ -209,6 +222,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
209
222
* 2023-11-15: :mod:`v2023_11_15.models<azure.mgmt.security.v2023_11_15.models>`
210
223
* 2024-01-01: :mod:`v2024_01_01.models<azure.mgmt.security.v2024_01_01.models>`
211
224
* 2024-04-01: :mod:`v2024_04_01.models<azure.mgmt.security.v2024_04_01.models>`
225
+ * 2024-08-01: :mod:`v2024_08_01.models<azure.mgmt.security.v2024_08_01.models>`
212
226
"""
213
227
if api_version == '2015-06-01-preview' :
214
228
from .v2015_06_01_preview import models
@@ -321,36 +335,11 @@ def models(cls, api_version=DEFAULT_API_VERSION):
321
335
elif api_version == '2024-04-01' :
322
336
from .v2024_04_01 import models
323
337
return models
338
+ elif api_version == '2024-08-01' :
339
+ from .v2024_08_01 import models
340
+ return models
324
341
raise ValueError ("API version {} is not available" .format (api_version ))
325
342
326
- @property
327
- def adaptive_application_controls (self ):
328
- """Instance depends on the API version:
329
-
330
- * 2020-01-01: :class:`AdaptiveApplicationControlsOperations<azure.mgmt.security.v2020_01_01.operations.AdaptiveApplicationControlsOperations>`
331
- """
332
- api_version = self ._get_api_version ('adaptive_application_controls' )
333
- if api_version == '2020-01-01' :
334
- from .v2020_01_01 .operations import AdaptiveApplicationControlsOperations as OperationClass
335
- else :
336
- raise ValueError ("API version {} does not have operation group 'adaptive_application_controls'" .format (api_version ))
337
- self ._config .api_version = api_version
338
- return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
339
-
340
- @property
341
- def adaptive_network_hardenings (self ):
342
- """Instance depends on the API version:
343
-
344
- * 2020-01-01: :class:`AdaptiveNetworkHardeningsOperations<azure.mgmt.security.v2020_01_01.operations.AdaptiveNetworkHardeningsOperations>`
345
- """
346
- api_version = self ._get_api_version ('adaptive_network_hardenings' )
347
- if api_version == '2020-01-01' :
348
- from .v2020_01_01 .operations import AdaptiveNetworkHardeningsOperations as OperationClass
349
- else :
350
- raise ValueError ("API version {} does not have operation group 'adaptive_network_hardenings'" .format (api_version ))
351
- self ._config .api_version = api_version
352
- return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
353
-
354
343
@property
355
344
def advanced_threat_protection (self ):
356
345
"""Instance depends on the API version:
@@ -677,6 +666,20 @@ def custom_entity_store_assignments(self):
677
666
self ._config .api_version = api_version
678
667
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
679
668
669
+ @property
670
+ def custom_recommendations (self ):
671
+ """Instance depends on the API version:
672
+
673
+ * 2024-08-01: :class:`CustomRecommendationsOperations<azure.mgmt.security.v2024_08_01.operations.CustomRecommendationsOperations>`
674
+ """
675
+ api_version = self ._get_api_version ('custom_recommendations' )
676
+ if api_version == '2024-08-01' :
677
+ from .v2024_08_01 .operations import CustomRecommendationsOperations as OperationClass
678
+ else :
679
+ raise ValueError ("API version {} does not have operation group 'custom_recommendations'" .format (api_version ))
680
+ self ._config .api_version = api_version
681
+ return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
682
+
680
683
@property
681
684
def defender_for_storage (self ):
682
685
"""Instance depends on the API version:
@@ -1257,6 +1260,20 @@ def security_solutions_reference_data(self):
1257
1260
self ._config .api_version = api_version
1258
1261
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
1259
1262
1263
+ @property
1264
+ def security_standards (self ):
1265
+ """Instance depends on the API version:
1266
+
1267
+ * 2024-08-01: :class:`SecurityStandardsOperations<azure.mgmt.security.v2024_08_01.operations.SecurityStandardsOperations>`
1268
+ """
1269
+ api_version = self ._get_api_version ('security_standards' )
1270
+ if api_version == '2024-08-01' :
1271
+ from .v2024_08_01 .operations import SecurityStandardsOperations as OperationClass
1272
+ else :
1273
+ raise ValueError ("API version {} does not have operation group 'security_standards'" .format (api_version ))
1274
+ self ._config .api_version = api_version
1275
+ return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
1276
+
1260
1277
@property
1261
1278
def sensitivity_settings (self ):
1262
1279
"""Instance depends on the API version:
@@ -1384,6 +1401,20 @@ def sql_vulnerability_assessment_scans(self):
1384
1401
self ._config .api_version = api_version
1385
1402
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
1386
1403
1404
+ @property
1405
+ def standard_assignments (self ):
1406
+ """Instance depends on the API version:
1407
+
1408
+ * 2024-08-01: :class:`StandardAssignmentsOperations<azure.mgmt.security.v2024_08_01.operations.StandardAssignmentsOperations>`
1409
+ """
1410
+ api_version = self ._get_api_version ('standard_assignments' )
1411
+ if api_version == '2024-08-01' :
1412
+ from .v2024_08_01 .operations import StandardAssignmentsOperations as OperationClass
1413
+ else :
1414
+ raise ValueError ("API version {} does not have operation group 'standard_assignments'" .format (api_version ))
1415
+ self ._config .api_version = api_version
1416
+ return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )), api_version )
1417
+
1387
1418
@property
1388
1419
def sub_assessments (self ):
1389
1420
"""Instance depends on the API version:
0 commit comments