Skip to content

Commit 9e45510

Browse files
authored
Generated from 1a24198dd982a4fcb510456404994241f55dc883 (#4113)
Settings API
1 parent b742759 commit 9e45510

11 files changed

+141
-108
lines changed

azure-mgmt-security/azure/mgmt/security/models/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .advanced_threat_protection_setting_py3 import AdvancedThreatProtectionSetting
2222
from .setting_py3 import Setting
2323
from .data_export_setting_py3 import DataExportSetting
24-
from .setting_kind1_py3 import SettingKind1
24+
from .setting_resource_py3 import SettingResource
2525
from .sensitivity_label_py3 import SensitivityLabel
2626
from .information_protection_keyword_py3 import InformationProtectionKeyword
2727
from .information_type_py3 import InformationType
@@ -75,7 +75,7 @@
7575
from .advanced_threat_protection_setting import AdvancedThreatProtectionSetting
7676
from .setting import Setting
7777
from .data_export_setting import DataExportSetting
78-
from .setting_kind1 import SettingKind1
78+
from .setting_resource import SettingResource
7979
from .sensitivity_label import SensitivityLabel
8080
from .information_protection_keyword import InformationProtectionKeyword
8181
from .information_type import InformationType
@@ -160,7 +160,7 @@
160160
'AdvancedThreatProtectionSetting',
161161
'Setting',
162162
'DataExportSetting',
163-
'SettingKind1',
163+
'SettingResource',
164164
'SensitivityLabel',
165165
'InformationProtectionKeyword',
166166
'InformationType',

azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ class DataExportSetting(Setting):
2626
:vartype name: str
2727
:ivar type: Resource type
2828
:vartype type: str
29-
:param kind: Required. Constant filled by server.
30-
:type kind: str
29+
:param kind: Required. the kind of the settings string
30+
(DataExportSetting). Possible values include: 'DataExportSetting',
31+
'AlertSuppressionSetting'
32+
:type kind: str or ~azure.mgmt.security.models.SettingKind
3133
:param enabled: Required. Is the data export setting is enabled
3234
:type enabled: bool
3335
"""
@@ -51,4 +53,3 @@ class DataExportSetting(Setting):
5153
def __init__(self, **kwargs):
5254
super(DataExportSetting, self).__init__(**kwargs)
5355
self.enabled = kwargs.get('enabled', None)
54-
self.kind = 'DataExportSetting'

azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ class DataExportSetting(Setting):
2626
:vartype name: str
2727
:ivar type: Resource type
2828
:vartype type: str
29-
:param kind: Required. Constant filled by server.
30-
:type kind: str
29+
:param kind: Required. the kind of the settings string
30+
(DataExportSetting). Possible values include: 'DataExportSetting',
31+
'AlertSuppressionSetting'
32+
:type kind: str or ~azure.mgmt.security.models.SettingKind
3133
:param enabled: Required. Is the data export setting is enabled
3234
:type enabled: bool
3335
"""
@@ -48,7 +50,6 @@ class DataExportSetting(Setting):
4850
'enabled': {'key': 'properties.enabled', 'type': 'bool'},
4951
}
5052

51-
def __init__(self, *, enabled: bool, **kwargs) -> None:
52-
super(DataExportSetting, self).__init__(**kwargs)
53+
def __init__(self, *, kind, enabled: bool, **kwargs) -> None:
54+
super(DataExportSetting, self).__init__(kind=kind, **kwargs)
5355
self.enabled = enabled
54-
self.kind = 'DataExportSetting'

azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class AutoProvision(str, Enum):
3939
class SettingKind(str, Enum):
4040

4141
data_export_setting = "DataExportSetting"
42+
alert_suppression_setting = "AlertSuppressionSetting"
4243

4344

4445
class SecurityFamily(str, Enum):

azure-mgmt-security/azure/mgmt/security/models/setting.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from msrest.serialization import Model
12+
from .setting_resource import SettingResource
1313

1414

15-
class Setting(Model):
15+
class Setting(SettingResource):
1616
"""Represents a security setting in Azure Security Center.
1717
18-
You probably want to use the sub-classes and not this class directly. Known
19-
sub-classes are: DataExportSetting
20-
2118
Variables are only populated by the server, and will be ignored when
2219
sending a request.
2320
@@ -29,8 +26,10 @@ class Setting(Model):
2926
:vartype name: str
3027
:ivar type: Resource type
3128
:vartype type: str
32-
:param kind: Required. Constant filled by server.
33-
:type kind: str
29+
:param kind: Required. the kind of the settings string
30+
(DataExportSetting). Possible values include: 'DataExportSetting',
31+
'AlertSuppressionSetting'
32+
:type kind: str or ~azure.mgmt.security.models.SettingKind
3433
"""
3534

3635
_validation = {
@@ -47,13 +46,5 @@ class Setting(Model):
4746
'kind': {'key': 'kind', 'type': 'str'},
4847
}
4948

50-
_subtype_map = {
51-
'kind': {'DataExportSetting': 'DataExportSetting'}
52-
}
53-
5449
def __init__(self, **kwargs):
5550
super(Setting, self).__init__(**kwargs)
56-
self.id = None
57-
self.name = None
58-
self.type = None
59-
self.kind = None

azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

azure-mgmt-security/azure/mgmt/security/models/setting_py3.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from msrest.serialization import Model
12+
from .setting_resource_py3 import SettingResource
1313

1414

15-
class Setting(Model):
15+
class Setting(SettingResource):
1616
"""Represents a security setting in Azure Security Center.
1717
18-
You probably want to use the sub-classes and not this class directly. Known
19-
sub-classes are: DataExportSetting
20-
2118
Variables are only populated by the server, and will be ignored when
2219
sending a request.
2320
@@ -29,8 +26,10 @@ class Setting(Model):
2926
:vartype name: str
3027
:ivar type: Resource type
3128
:vartype type: str
32-
:param kind: Required. Constant filled by server.
33-
:type kind: str
29+
:param kind: Required. the kind of the settings string
30+
(DataExportSetting). Possible values include: 'DataExportSetting',
31+
'AlertSuppressionSetting'
32+
:type kind: str or ~azure.mgmt.security.models.SettingKind
3433
"""
3534

3635
_validation = {
@@ -47,13 +46,5 @@ class Setting(Model):
4746
'kind': {'key': 'kind', 'type': 'str'},
4847
}
4948

50-
_subtype_map = {
51-
'kind': {'DataExportSetting': 'DataExportSetting'}
52-
}
53-
54-
def __init__(self, **kwargs) -> None:
55-
super(Setting, self).__init__(**kwargs)
56-
self.id = None
57-
self.name = None
58-
self.type = None
59-
self.kind = None
49+
def __init__(self, *, kind, **kwargs) -> None:
50+
super(Setting, self).__init__(kind=kind, **kwargs)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from .resource import Resource
13+
14+
15+
class SettingResource(Resource):
16+
"""The kind of the security setting.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
All required parameters must be populated in order to send to Azure.
22+
23+
:ivar id: Resource Id
24+
:vartype id: str
25+
:ivar name: Resource name
26+
:vartype name: str
27+
:ivar type: Resource type
28+
:vartype type: str
29+
:param kind: Required. the kind of the settings string
30+
(DataExportSetting). Possible values include: 'DataExportSetting',
31+
'AlertSuppressionSetting'
32+
:type kind: str or ~azure.mgmt.security.models.SettingKind
33+
"""
34+
35+
_validation = {
36+
'id': {'readonly': True},
37+
'name': {'readonly': True},
38+
'type': {'readonly': True},
39+
'kind': {'required': True},
40+
}
41+
42+
_attribute_map = {
43+
'id': {'key': 'id', 'type': 'str'},
44+
'name': {'key': 'name', 'type': 'str'},
45+
'type': {'key': 'type', 'type': 'str'},
46+
'kind': {'key': 'kind', 'type': 'str'},
47+
}
48+
49+
def __init__(self, **kwargs):
50+
super(SettingResource, self).__init__(**kwargs)
51+
self.kind = kwargs.get('kind', None)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from .resource_py3 import Resource
13+
14+
15+
class SettingResource(Resource):
16+
"""The kind of the security setting.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
All required parameters must be populated in order to send to Azure.
22+
23+
:ivar id: Resource Id
24+
:vartype id: str
25+
:ivar name: Resource name
26+
:vartype name: str
27+
:ivar type: Resource type
28+
:vartype type: str
29+
:param kind: Required. the kind of the settings string
30+
(DataExportSetting). Possible values include: 'DataExportSetting',
31+
'AlertSuppressionSetting'
32+
:type kind: str or ~azure.mgmt.security.models.SettingKind
33+
"""
34+
35+
_validation = {
36+
'id': {'readonly': True},
37+
'name': {'readonly': True},
38+
'type': {'readonly': True},
39+
'kind': {'required': True},
40+
}
41+
42+
_attribute_map = {
43+
'id': {'key': 'id', 'type': 'str'},
44+
'name': {'key': 'name', 'type': 'str'},
45+
'type': {'key': 'type', 'type': 'str'},
46+
'kind': {'key': 'kind', 'type': 'str'},
47+
}
48+
49+
def __init__(self, *, kind, **kwargs) -> None:
50+
super(SettingResource, self).__init__(**kwargs)
51+
self.kind = kind

azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def get(
105105
self, setting_name, custom_headers=None, raw=False, **operation_config):
106106
"""Settings of different configurations in security center.
107107
108-
:param setting_name: Name of setting. Possible values include: 'MCAS',
109-
'WDATP'
108+
:param setting_name: Name of setting: (MCAS/WDATP). Possible values
109+
include: 'MCAS', 'WDATP'
110110
:type setting_name: str
111111
:param dict custom_headers: headers that will be added to the request
112112
:param bool raw: returns the direct response alongside the
@@ -162,14 +162,16 @@ def get(
162162
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'}
163163

164164
def update(
165-
self, setting_name, setting, custom_headers=None, raw=False, **operation_config):
165+
self, setting_name, kind, custom_headers=None, raw=False, **operation_config):
166166
"""updating settings about different configurations in security center.
167167
168-
:param setting_name: Name of setting. Possible values include: 'MCAS',
169-
'WDATP'
168+
:param setting_name: Name of setting: (MCAS/WDATP). Possible values
169+
include: 'MCAS', 'WDATP'
170170
:type setting_name: str
171-
:param setting: Setting object
172-
:type setting: ~azure.mgmt.security.models.Setting
171+
:param kind: the kind of the settings string (DataExportSetting).
172+
Possible values include: 'DataExportSetting',
173+
'AlertSuppressionSetting'
174+
:type kind: str or ~azure.mgmt.security.models.SettingKind
173175
:param dict custom_headers: headers that will be added to the request
174176
:param bool raw: returns the direct response alongside the
175177
deserialized response
@@ -180,6 +182,8 @@ def update(
180182
~msrest.pipeline.ClientRawResponse
181183
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
182184
"""
185+
setting = models.Setting(kind=kind)
186+
183187
# Construct URL
184188
url = self.update.metadata['url']
185189
path_format_arguments = {

0 commit comments

Comments
 (0)