From a163d035960c47d67afecc46a1c5a59795f33fef Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 13 Feb 2019 11:35:23 +0000 Subject: [PATCH 1/2] Generated from 2a8aacac69e7675f0417a2dee3770256656042c8 first break-to-composite attempt --- .../azure/mgmt/security/models/__init__.py | 114 +---- .../advanced_threat_protection_setting.py | 47 -- .../advanced_threat_protection_setting_py3.py | 47 -- .../models/auto_provisioning_setting.py | 50 -- .../models/auto_provisioning_setting_paged.py | 27 -- .../models/auto_provisioning_setting_py3.py | 50 -- .../azure/mgmt/security/models/compliance.py | 62 --- .../mgmt/security/models/compliance_paged.py | 27 -- .../mgmt/security/models/compliance_py3.py | 62 --- .../security/models/compliance_segment.py | 41 -- .../security/models/compliance_segment_py3.py | 41 -- .../security/models/data_export_setting.py | 55 --- .../models/data_export_setting_py3.py | 55 --- .../models/information_protection_keyword.py | 41 -- .../information_protection_keyword_py3.py | 41 -- .../models/information_protection_policy.py | 57 --- .../information_protection_policy_paged.py | 27 -- .../information_protection_policy_py3.py | 57 --- .../mgmt/security/models/information_type.py | 50 -- .../security/models/information_type_py3.py | 50 -- .../azure/mgmt/security/models/pricing.py | 50 -- .../mgmt/security/models/pricing_paged.py | 27 -- .../azure/mgmt/security/models/pricing_py3.py | 50 -- .../security/models/security_center_enums.py | 30 -- .../mgmt/security/models/security_contact.py | 67 --- .../security/models/security_contact_paged.py | 27 -- .../security/models/security_contact_py3.py | 67 --- .../mgmt/security/models/sensitivity_label.py | 36 -- .../security/models/sensitivity_label_py3.py | 36 -- .../azure/mgmt/security/models/setting.py | 50 -- .../mgmt/security/models/setting_paged.py | 27 -- .../azure/mgmt/security/models/setting_py3.py | 50 -- .../mgmt/security/models/setting_resource.py | 51 --- .../security/models/setting_resource_py3.py | 51 --- .../mgmt/security/models/workspace_setting.py | 57 --- .../models/workspace_setting_paged.py | 27 -- .../security/models/workspace_setting_py3.py | 57 --- .../mgmt/security/operations/__init__.py | 16 - .../advanced_threat_protection_operations.py | 171 ------- .../auto_provisioning_settings_operations.py | 229 --------- .../operations/compliances_operations.py | 169 ------- ...ormation_protection_policies_operations.py | 236 ---------- .../operations/pricings_operations.py | 433 ------------------ .../security_contacts_operations.py | 341 -------------- .../operations/settings_operations.py | 232 ---------- .../workspace_settings_operations.py | 361 --------------- .../azure/mgmt/security/security_center.py | 61 +-- 47 files changed, 35 insertions(+), 3975 deletions(-) delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_type.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/security_contact.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_resource.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index ff8b9164b7ee..df5a1d53e437 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -10,36 +10,17 @@ # -------------------------------------------------------------------------- try: - from .resource_py3 import Resource - from .kind_py3 import Kind - from .security_contact_py3 import SecurityContact - from .pricing_py3 import Pricing - from .workspace_setting_py3 import WorkspaceSetting - from .auto_provisioning_setting_py3 import AutoProvisioningSetting - from .compliance_segment_py3 import ComplianceSegment - from .compliance_py3 import Compliance - from .advanced_threat_protection_setting_py3 import AdvancedThreatProtectionSetting - from .setting_py3 import Setting - from .data_export_setting_py3 import DataExportSetting - from .setting_resource_py3 import SettingResource - from .sensitivity_label_py3 import SensitivityLabel - from .information_protection_keyword_py3 import InformationProtectionKeyword - from .information_type_py3 import InformationType - from .information_protection_policy_py3 import InformationProtectionPolicy - from .location_py3 import Location from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation + from .resource_py3 import Resource + from .asc_location_py3 import AscLocation from .security_task_parameters_py3 import SecurityTaskParameters from .security_task_py3 import SecurityTask - from .asc_location_py3 import AscLocation from .alert_entity_py3 import AlertEntity from .alert_confidence_reason_py3 import AlertConfidenceReason from .alert_py3 import Alert from .discovered_security_solution_py3 import DiscoveredSecuritySolution - from .topology_single_resource_parent_py3 import TopologySingleResourceParent - from .topology_single_resource_child_py3 import TopologySingleResourceChild - from .topology_single_resource_py3 import TopologySingleResource - from .topology_resource_py3 import TopologyResource + from .location_py3 import Location from .jit_network_access_port_rule_py3 import JitNetworkAccessPortRule from .jit_network_access_policy_virtual_machine_py3 import JitNetworkAccessPolicyVirtualMachine from .jit_network_access_request_port_py3 import JitNetworkAccessRequestPort @@ -49,6 +30,7 @@ from .jit_network_access_policy_initiate_port_py3 import JitNetworkAccessPolicyInitiatePort from .jit_network_access_policy_initiate_virtual_machine_py3 import JitNetworkAccessPolicyInitiateVirtualMachine from .jit_network_access_policy_initiate_request_py3 import JitNetworkAccessPolicyInitiateRequest + from .kind_py3 import Kind from .external_security_solution_py3 import ExternalSecuritySolution from .cef_solution_properties_py3 import CefSolutionProperties from .cef_external_security_solution_py3 import CefExternalSecuritySolution @@ -60,40 +42,25 @@ from .external_security_solution_kind1_py3 import ExternalSecuritySolutionKind1 from .external_security_solution_properties_py3 import ExternalSecuritySolutionProperties from .aad_connectivity_state1_py3 import AadConnectivityState1 + from .topology_single_resource_parent_py3 import TopologySingleResourceParent + from .topology_single_resource_child_py3 import TopologySingleResourceChild + from .topology_single_resource_py3 import TopologySingleResource + from .topology_resource_py3 import TopologyResource from .connected_resource_py3 import ConnectedResource from .connectable_resource_py3 import ConnectableResource from .allowed_connections_resource_py3 import AllowedConnectionsResource except (SyntaxError, ImportError): - from .resource import Resource - from .kind import Kind - from .security_contact import SecurityContact - from .pricing import Pricing - from .workspace_setting import WorkspaceSetting - from .auto_provisioning_setting import AutoProvisioningSetting - from .compliance_segment import ComplianceSegment - from .compliance import Compliance - from .advanced_threat_protection_setting import AdvancedThreatProtectionSetting - from .setting import Setting - from .data_export_setting import DataExportSetting - from .setting_resource import SettingResource - from .sensitivity_label import SensitivityLabel - from .information_protection_keyword import InformationProtectionKeyword - from .information_type import InformationType - from .information_protection_policy import InformationProtectionPolicy - from .location import Location from .operation_display import OperationDisplay from .operation import Operation + from .resource import Resource + from .asc_location import AscLocation from .security_task_parameters import SecurityTaskParameters from .security_task import SecurityTask - from .asc_location import AscLocation from .alert_entity import AlertEntity from .alert_confidence_reason import AlertConfidenceReason from .alert import Alert from .discovered_security_solution import DiscoveredSecuritySolution - from .topology_single_resource_parent import TopologySingleResourceParent - from .topology_single_resource_child import TopologySingleResourceChild - from .topology_single_resource import TopologySingleResource - from .topology_resource import TopologyResource + from .location import Location from .jit_network_access_port_rule import JitNetworkAccessPortRule from .jit_network_access_policy_virtual_machine import JitNetworkAccessPolicyVirtualMachine from .jit_network_access_request_port import JitNetworkAccessRequestPort @@ -103,6 +70,7 @@ from .jit_network_access_policy_initiate_port import JitNetworkAccessPolicyInitiatePort from .jit_network_access_policy_initiate_virtual_machine import JitNetworkAccessPolicyInitiateVirtualMachine from .jit_network_access_policy_initiate_request import JitNetworkAccessPolicyInitiateRequest + from .kind import Kind from .external_security_solution import ExternalSecuritySolution from .cef_solution_properties import CefSolutionProperties from .cef_external_security_solution import CefExternalSecuritySolution @@ -114,16 +82,13 @@ from .external_security_solution_kind1 import ExternalSecuritySolutionKind1 from .external_security_solution_properties import ExternalSecuritySolutionProperties from .aad_connectivity_state1 import AadConnectivityState1 + from .topology_single_resource_parent import TopologySingleResourceParent + from .topology_single_resource_child import TopologySingleResourceChild + from .topology_single_resource import TopologySingleResource + from .topology_resource import TopologyResource from .connected_resource import ConnectedResource from .connectable_resource import ConnectableResource from .allowed_connections_resource import AllowedConnectionsResource -from .pricing_paged import PricingPaged -from .security_contact_paged import SecurityContactPaged -from .workspace_setting_paged import WorkspaceSettingPaged -from .auto_provisioning_setting_paged import AutoProvisioningSettingPaged -from .compliance_paged import CompliancePaged -from .setting_paged import SettingPaged -from .information_protection_policy_paged import InformationProtectionPolicyPaged from .operation_paged import OperationPaged from .asc_location_paged import AscLocationPaged from .security_task_paged import SecurityTaskPaged @@ -134,11 +99,6 @@ from .topology_resource_paged import TopologyResourcePaged from .allowed_connections_resource_paged import AllowedConnectionsResourcePaged from .security_center_enums import ( - AlertNotifications, - AlertsToAdmins, - PricingTier, - AutoProvision, - SettingKind, ReportedSeverity, SecurityFamily, Protocol, @@ -150,36 +110,17 @@ ) __all__ = [ - 'Resource', - 'Kind', - 'SecurityContact', - 'Pricing', - 'WorkspaceSetting', - 'AutoProvisioningSetting', - 'ComplianceSegment', - 'Compliance', - 'AdvancedThreatProtectionSetting', - 'Setting', - 'DataExportSetting', - 'SettingResource', - 'SensitivityLabel', - 'InformationProtectionKeyword', - 'InformationType', - 'InformationProtectionPolicy', - 'Location', 'OperationDisplay', 'Operation', + 'Resource', + 'AscLocation', 'SecurityTaskParameters', 'SecurityTask', - 'AscLocation', 'AlertEntity', 'AlertConfidenceReason', 'Alert', 'DiscoveredSecuritySolution', - 'TopologySingleResourceParent', - 'TopologySingleResourceChild', - 'TopologySingleResource', - 'TopologyResource', + 'Location', 'JitNetworkAccessPortRule', 'JitNetworkAccessPolicyVirtualMachine', 'JitNetworkAccessRequestPort', @@ -189,6 +130,7 @@ 'JitNetworkAccessPolicyInitiatePort', 'JitNetworkAccessPolicyInitiateVirtualMachine', 'JitNetworkAccessPolicyInitiateRequest', + 'Kind', 'ExternalSecuritySolution', 'CefSolutionProperties', 'CefExternalSecuritySolution', @@ -200,16 +142,13 @@ 'ExternalSecuritySolutionKind1', 'ExternalSecuritySolutionProperties', 'AadConnectivityState1', + 'TopologySingleResourceParent', + 'TopologySingleResourceChild', + 'TopologySingleResource', + 'TopologyResource', 'ConnectedResource', 'ConnectableResource', 'AllowedConnectionsResource', - 'PricingPaged', - 'SecurityContactPaged', - 'WorkspaceSettingPaged', - 'AutoProvisioningSettingPaged', - 'CompliancePaged', - 'SettingPaged', - 'InformationProtectionPolicyPaged', 'OperationPaged', 'AscLocationPaged', 'SecurityTaskPaged', @@ -219,11 +158,6 @@ 'ExternalSecuritySolutionPaged', 'TopologyResourcePaged', 'AllowedConnectionsResourcePaged', - 'AlertNotifications', - 'AlertsToAdmins', - 'PricingTier', - 'AutoProvision', - 'SettingKind', 'ReportedSeverity', 'SecurityFamily', 'Protocol', diff --git a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py deleted file mode 100644 index 722352481320..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class AdvancedThreatProtectionSetting(Resource): - """The Advanced Threat Protection resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param is_enabled: Indicates whether Advanced Threat Protection is - enabled. - :type is_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(AdvancedThreatProtectionSetting, self).__init__(**kwargs) - self.is_enabled = kwargs.get('is_enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py deleted file mode 100644 index 66ed9c5fe2ec..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class AdvancedThreatProtectionSetting(Resource): - """The Advanced Threat Protection resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param is_enabled: Indicates whether Advanced Threat Protection is - enabled. - :type is_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, - } - - def __init__(self, *, is_enabled: bool=None, **kwargs) -> None: - super(AdvancedThreatProtectionSetting, self).__init__(**kwargs) - self.is_enabled = is_enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py deleted file mode 100644 index 907869accb3d..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class AutoProvisioningSetting(Resource): - """Auto provisioning setting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param auto_provision: Required. Describes what kind of security agent - provisioning action to take. Possible values include: 'On', 'Off' - :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'auto_provision': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'auto_provision': {'key': 'properties.autoProvision', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AutoProvisioningSetting, self).__init__(**kwargs) - self.auto_provision = kwargs.get('auto_provision', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py deleted file mode 100644 index a618c42c075c..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class AutoProvisioningSettingPaged(Paged): - """ - A paging container for iterating over a list of :class:`AutoProvisioningSetting ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AutoProvisioningSetting]'} - } - - def __init__(self, *args, **kwargs): - - super(AutoProvisioningSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py deleted file mode 100644 index 7c86b8da5c01..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class AutoProvisioningSetting(Resource): - """Auto provisioning setting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param auto_provision: Required. Describes what kind of security agent - provisioning action to take. Possible values include: 'On', 'Off' - :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'auto_provision': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'auto_provision': {'key': 'properties.autoProvision', 'type': 'str'}, - } - - def __init__(self, *, auto_provision, **kwargs) -> None: - super(AutoProvisioningSetting, self).__init__(**kwargs) - self.auto_provision = auto_provision diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance.py b/azure-mgmt-security/azure/mgmt/security/models/compliance.py deleted file mode 100644 index f515b35211bd..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/compliance.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Compliance(Resource): - """Compliance of a scope. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :ivar assessment_timestamp_utc_date: The timestamp when the Compliance - calculation was conducted. - :vartype assessment_timestamp_utc_date: datetime - :ivar resource_count: The resource count of the given subscription for - which the Compliance calculation was conducted (needed for Management - Group Compliance calculation). - :vartype resource_count: int - :ivar assessment_result: An array of segment, which is the actually the - compliance assessment. - :vartype assessment_result: - list[~azure.mgmt.security.models.ComplianceSegment] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'assessment_timestamp_utc_date': {'readonly': True}, - 'resource_count': {'readonly': True}, - 'assessment_result': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'assessment_timestamp_utc_date': {'key': 'properties.assessmentTimestampUtcDate', 'type': 'iso-8601'}, - 'resource_count': {'key': 'properties.resourceCount', 'type': 'int'}, - 'assessment_result': {'key': 'properties.assessmentResult', 'type': '[ComplianceSegment]'}, - } - - def __init__(self, **kwargs): - super(Compliance, self).__init__(**kwargs) - self.assessment_timestamp_utc_date = None - self.resource_count = None - self.assessment_result = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py deleted file mode 100644 index 4e2030375270..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class CompliancePaged(Paged): - """ - A paging container for iterating over a list of :class:`Compliance ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Compliance]'} - } - - def __init__(self, *args, **kwargs): - - super(CompliancePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py deleted file mode 100644 index 0e271a1351b4..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Compliance(Resource): - """Compliance of a scope. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :ivar assessment_timestamp_utc_date: The timestamp when the Compliance - calculation was conducted. - :vartype assessment_timestamp_utc_date: datetime - :ivar resource_count: The resource count of the given subscription for - which the Compliance calculation was conducted (needed for Management - Group Compliance calculation). - :vartype resource_count: int - :ivar assessment_result: An array of segment, which is the actually the - compliance assessment. - :vartype assessment_result: - list[~azure.mgmt.security.models.ComplianceSegment] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'assessment_timestamp_utc_date': {'readonly': True}, - 'resource_count': {'readonly': True}, - 'assessment_result': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'assessment_timestamp_utc_date': {'key': 'properties.assessmentTimestampUtcDate', 'type': 'iso-8601'}, - 'resource_count': {'key': 'properties.resourceCount', 'type': 'int'}, - 'assessment_result': {'key': 'properties.assessmentResult', 'type': '[ComplianceSegment]'}, - } - - def __init__(self, **kwargs) -> None: - super(Compliance, self).__init__(**kwargs) - self.assessment_timestamp_utc_date = None - self.resource_count = None - self.assessment_result = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py deleted file mode 100644 index ea23dc49c079..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ComplianceSegment(Model): - """A segment of a compliance assessment. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar segment_type: The segment type, e.g. compliant, non-compliance, - insufficient coverage, N/A, etc. - :vartype segment_type: str - :ivar percentage: The size (%) of the segment. - :vartype percentage: float - """ - - _validation = { - 'segment_type': {'readonly': True}, - 'percentage': {'readonly': True}, - } - - _attribute_map = { - 'segment_type': {'key': 'segmentType', 'type': 'str'}, - 'percentage': {'key': 'percentage', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ComplianceSegment, self).__init__(**kwargs) - self.segment_type = None - self.percentage = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py deleted file mode 100644 index a819e7cde997..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ComplianceSegment(Model): - """A segment of a compliance assessment. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar segment_type: The segment type, e.g. compliant, non-compliance, - insufficient coverage, N/A, etc. - :vartype segment_type: str - :ivar percentage: The size (%) of the segment. - :vartype percentage: float - """ - - _validation = { - 'segment_type': {'readonly': True}, - 'percentage': {'readonly': True}, - } - - _attribute_map = { - 'segment_type': {'key': 'segmentType', 'type': 'str'}, - 'percentage': {'key': 'percentage', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(ComplianceSegment, self).__init__(**kwargs) - self.segment_type = None - self.percentage = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py deleted file mode 100644 index 8c355e50e6ff..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .setting import Setting - - -class DataExportSetting(Setting): - """Represents a data export setting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. the kind of the settings string - (DataExportSetting). Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - :param enabled: Required. Is the data export setting is enabled - :type enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - 'enabled': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(DataExportSetting, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py deleted file mode 100644 index 05d8e11208fc..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .setting_py3 import Setting - - -class DataExportSetting(Setting): - """Represents a data export setting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. the kind of the settings string - (DataExportSetting). Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - :param enabled: Required. Is the data export setting is enabled - :type enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - 'enabled': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - } - - def __init__(self, *, kind, enabled: bool, **kwargs) -> None: - super(DataExportSetting, self).__init__(kind=kind, **kwargs) - self.enabled = enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py deleted file mode 100644 index b67a1d4cfbd1..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InformationProtectionKeyword(Model): - """The information type keyword. - - :param pattern: The keyword pattern. - :type pattern: str - :param custom: Indicates whether the keyword is custom or not. - :type custom: bool - :param can_be_numeric: Indicates whether the keyword can be applied on - numeric types or not. - :type can_be_numeric: bool - :param excluded: Indicates whether the keyword is excluded or not. - :type excluded: bool - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'custom': {'key': 'custom', 'type': 'bool'}, - 'can_be_numeric': {'key': 'canBeNumeric', 'type': 'bool'}, - 'excluded': {'key': 'excluded', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(InformationProtectionKeyword, self).__init__(**kwargs) - self.pattern = kwargs.get('pattern', None) - self.custom = kwargs.get('custom', None) - self.can_be_numeric = kwargs.get('can_be_numeric', None) - self.excluded = kwargs.get('excluded', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py deleted file mode 100644 index 52c424cd4452..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InformationProtectionKeyword(Model): - """The information type keyword. - - :param pattern: The keyword pattern. - :type pattern: str - :param custom: Indicates whether the keyword is custom or not. - :type custom: bool - :param can_be_numeric: Indicates whether the keyword can be applied on - numeric types or not. - :type can_be_numeric: bool - :param excluded: Indicates whether the keyword is excluded or not. - :type excluded: bool - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'custom': {'key': 'custom', 'type': 'bool'}, - 'can_be_numeric': {'key': 'canBeNumeric', 'type': 'bool'}, - 'excluded': {'key': 'excluded', 'type': 'bool'}, - } - - def __init__(self, *, pattern: str=None, custom: bool=None, can_be_numeric: bool=None, excluded: bool=None, **kwargs) -> None: - super(InformationProtectionKeyword, self).__init__(**kwargs) - self.pattern = pattern - self.custom = custom - self.can_be_numeric = can_be_numeric - self.excluded = excluded diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py deleted file mode 100644 index c430a8605127..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class InformationProtectionPolicy(Resource): - """Information protection policy. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :ivar last_modified_utc: Describes the last UTC time the policy was - modified. - :vartype last_modified_utc: datetime - :param labels: Dictionary of sensitivity labels. - :type labels: dict[str, ~azure.mgmt.security.models.SensitivityLabel] - :param information_types: The sensitivity information types. - :type information_types: dict[str, - ~azure.mgmt.security.models.InformationType] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_utc': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'iso-8601'}, - 'labels': {'key': 'properties.labels', 'type': '{SensitivityLabel}'}, - 'information_types': {'key': 'properties.informationTypes', 'type': '{InformationType}'}, - } - - def __init__(self, **kwargs): - super(InformationProtectionPolicy, self).__init__(**kwargs) - self.last_modified_utc = None - self.labels = kwargs.get('labels', None) - self.information_types = kwargs.get('information_types', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py deleted file mode 100644 index 807d040d4f4b..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class InformationProtectionPolicyPaged(Paged): - """ - A paging container for iterating over a list of :class:`InformationProtectionPolicy ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[InformationProtectionPolicy]'} - } - - def __init__(self, *args, **kwargs): - - super(InformationProtectionPolicyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py deleted file mode 100644 index e07676bb0d27..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class InformationProtectionPolicy(Resource): - """Information protection policy. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :ivar last_modified_utc: Describes the last UTC time the policy was - modified. - :vartype last_modified_utc: datetime - :param labels: Dictionary of sensitivity labels. - :type labels: dict[str, ~azure.mgmt.security.models.SensitivityLabel] - :param information_types: The sensitivity information types. - :type information_types: dict[str, - ~azure.mgmt.security.models.InformationType] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_utc': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'iso-8601'}, - 'labels': {'key': 'properties.labels', 'type': '{SensitivityLabel}'}, - 'information_types': {'key': 'properties.informationTypes', 'type': '{InformationType}'}, - } - - def __init__(self, *, labels=None, information_types=None, **kwargs) -> None: - super(InformationProtectionPolicy, self).__init__(**kwargs) - self.last_modified_utc = None - self.labels = labels - self.information_types = information_types diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_type.py b/azure-mgmt-security/azure/mgmt/security/models/information_type.py deleted file mode 100644 index df77e7c1ff65..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_type.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InformationType(Model): - """The information type. - - :param display_name: The name of the information type. - :type display_name: str - :param order: The order of the information type. - :type order: float - :param recommended_label_id: The recommended label id to be associated - with this information type. - :type recommended_label_id: str - :param enabled: Indicates whether the information type is enabled or not. - :type enabled: bool - :param custom: Indicates whether the information type is custom or not. - :type custom: bool - :param keywords: The information type keywords. - :type keywords: - list[~azure.mgmt.security.models.InformationProtectionKeyword] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'float'}, - 'recommended_label_id': {'key': 'recommendedLabelId', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'custom': {'key': 'custom', 'type': 'bool'}, - 'keywords': {'key': 'keywords', 'type': '[InformationProtectionKeyword]'}, - } - - def __init__(self, **kwargs): - super(InformationType, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.order = kwargs.get('order', None) - self.recommended_label_id = kwargs.get('recommended_label_id', None) - self.enabled = kwargs.get('enabled', None) - self.custom = kwargs.get('custom', None) - self.keywords = kwargs.get('keywords', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py deleted file mode 100644 index b8b1ab434c82..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InformationType(Model): - """The information type. - - :param display_name: The name of the information type. - :type display_name: str - :param order: The order of the information type. - :type order: float - :param recommended_label_id: The recommended label id to be associated - with this information type. - :type recommended_label_id: str - :param enabled: Indicates whether the information type is enabled or not. - :type enabled: bool - :param custom: Indicates whether the information type is custom or not. - :type custom: bool - :param keywords: The information type keywords. - :type keywords: - list[~azure.mgmt.security.models.InformationProtectionKeyword] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'float'}, - 'recommended_label_id': {'key': 'recommendedLabelId', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'custom': {'key': 'custom', 'type': 'bool'}, - 'keywords': {'key': 'keywords', 'type': '[InformationProtectionKeyword]'}, - } - - def __init__(self, *, display_name: str=None, order: float=None, recommended_label_id: str=None, enabled: bool=None, custom: bool=None, keywords=None, **kwargs) -> None: - super(InformationType, self).__init__(**kwargs) - self.display_name = display_name - self.order = order - self.recommended_label_id = recommended_label_id - self.enabled = enabled - self.custom = custom - self.keywords = keywords diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing.py b/azure-mgmt-security/azure/mgmt/security/models/pricing.py deleted file mode 100644 index 320e3dc9e4dc..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/pricing.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Pricing(Resource): - """Pricing tier will be applied for the scope based on the resource ID. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param pricing_tier: Required. Pricing tier type. Possible values include: - 'Free', 'Standard' - :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'pricing_tier': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Pricing, self).__init__(**kwargs) - self.pricing_tier = kwargs.get('pricing_tier', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py deleted file mode 100644 index 09eee4ab69dd..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class PricingPaged(Paged): - """ - A paging container for iterating over a list of :class:`Pricing ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Pricing]'} - } - - def __init__(self, *args, **kwargs): - - super(PricingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py deleted file mode 100644 index 25001e835a78..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Pricing(Resource): - """Pricing tier will be applied for the scope based on the resource ID. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param pricing_tier: Required. Pricing tier type. Possible values include: - 'Free', 'Standard' - :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'pricing_tier': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, - } - - def __init__(self, *, pricing_tier, **kwargs) -> None: - super(Pricing, self).__init__(**kwargs) - self.pricing_tier = pricing_tier diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py index 645bc5d68041..018d83a94039 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -12,36 +12,6 @@ from enum import Enum -class AlertNotifications(str, Enum): - - on = "On" #: Get notifications on new alerts - off = "Off" #: Don't get notifications on new alerts - - -class AlertsToAdmins(str, Enum): - - on = "On" #: Send notification on new alerts to the subscription's admins - off = "Off" #: Don't send notification on new alerts to the subscription's admins - - -class PricingTier(str, Enum): - - free = "Free" #: Get free Azure security center experience with basic security features - standard = "Standard" #: Get the standard Azure security center experience with advanced security features - - -class AutoProvision(str, Enum): - - on = "On" #: Install missing security agent on VMs automatically - off = "Off" #: Do not install security agent on the VMs automatically - - -class SettingKind(str, Enum): - - data_export_setting = "DataExportSetting" - alert_suppression_setting = "AlertSuppressionSetting" - - class ReportedSeverity(str, Enum): silent = "Silent" diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact.py deleted file mode 100644 index 43926670b0ec..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/security_contact.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class SecurityContact(Resource): - """Contact details for security issues. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param email: Required. The email of this security contact - :type email: str - :param phone: The phone number of this security contact - :type phone: str - :param alert_notifications: Required. Whether to send security alerts - notifications to the security contact. Possible values include: 'On', - 'Off' - :type alert_notifications: str or - ~azure.mgmt.security.models.AlertNotifications - :param alerts_to_admins: Required. Whether to send security alerts - notifications to subscription admins. Possible values include: 'On', 'Off' - :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'email': {'required': True}, - 'alert_notifications': {'required': True}, - 'alerts_to_admins': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'email': {'key': 'properties.email', 'type': 'str'}, - 'phone': {'key': 'properties.phone', 'type': 'str'}, - 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, - 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SecurityContact, self).__init__(**kwargs) - self.email = kwargs.get('email', None) - self.phone = kwargs.get('phone', None) - self.alert_notifications = kwargs.get('alert_notifications', None) - self.alerts_to_admins = kwargs.get('alerts_to_admins', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py deleted file mode 100644 index a422f9bd58b7..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class SecurityContactPaged(Paged): - """ - A paging container for iterating over a list of :class:`SecurityContact ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SecurityContact]'} - } - - def __init__(self, *args, **kwargs): - - super(SecurityContactPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py deleted file mode 100644 index 6a78f995545a..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class SecurityContact(Resource): - """Contact details for security issues. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param email: Required. The email of this security contact - :type email: str - :param phone: The phone number of this security contact - :type phone: str - :param alert_notifications: Required. Whether to send security alerts - notifications to the security contact. Possible values include: 'On', - 'Off' - :type alert_notifications: str or - ~azure.mgmt.security.models.AlertNotifications - :param alerts_to_admins: Required. Whether to send security alerts - notifications to subscription admins. Possible values include: 'On', 'Off' - :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'email': {'required': True}, - 'alert_notifications': {'required': True}, - 'alerts_to_admins': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'email': {'key': 'properties.email', 'type': 'str'}, - 'phone': {'key': 'properties.phone', 'type': 'str'}, - 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, - 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, - } - - def __init__(self, *, email: str, alert_notifications, alerts_to_admins, phone: str=None, **kwargs) -> None: - super(SecurityContact, self).__init__(**kwargs) - self.email = email - self.phone = phone - self.alert_notifications = alert_notifications - self.alerts_to_admins = alerts_to_admins diff --git a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py deleted file mode 100644 index 09fd4a0bee30..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SensitivityLabel(Model): - """The sensitivity label. - - :param display_name: The name of the sensitivity label. - :type display_name: str - :param order: The order of the sensitivity label. - :type order: float - :param enabled: Indicates whether the label is enabled or not. - :type enabled: bool - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'float'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(SensitivityLabel, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.order = kwargs.get('order', None) - self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py deleted file mode 100644 index 79b0766f48c8..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SensitivityLabel(Model): - """The sensitivity label. - - :param display_name: The name of the sensitivity label. - :type display_name: str - :param order: The order of the sensitivity label. - :type order: float - :param enabled: Indicates whether the label is enabled or not. - :type enabled: bool - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'float'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__(self, *, display_name: str=None, order: float=None, enabled: bool=None, **kwargs) -> None: - super(SensitivityLabel, self).__init__(**kwargs) - self.display_name = display_name - self.order = order - self.enabled = enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting.py b/azure-mgmt-security/azure/mgmt/security/models/setting.py deleted file mode 100644 index 9dd2c8f9944c..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/setting.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .setting_resource import SettingResource - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. the kind of the settings string - (DataExportSetting). Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Setting, self).__init__(**kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py deleted file mode 100644 index 5ab8b2585b4a..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class SettingPaged(Paged): - """ - A paging container for iterating over a list of :class:`Setting ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Setting]'} - } - - def __init__(self, *args, **kwargs): - - super(SettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py deleted file mode 100644 index 0611d4ebdd49..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .setting_resource_py3 import SettingResource - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. the kind of the settings string - (DataExportSetting). Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, *, kind, **kwargs) -> None: - super(Setting, self).__init__(kind=kind, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py b/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py deleted file mode 100644 index d20bda7cab66..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class SettingResource(Resource): - """The kind of the security setting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. the kind of the settings string - (DataExportSetting). Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SettingResource, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py deleted file mode 100644 index 4feeff7166c5..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class SettingResource(Resource): - """The kind of the security setting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. the kind of the settings string - (DataExportSetting). Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, *, kind, **kwargs) -> None: - super(SettingResource, self).__init__(**kwargs) - self.kind = kind diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py deleted file mode 100644 index 327a5b9d8897..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class WorkspaceSetting(Resource): - """Configures where to store the OMS agent data for workspaces under a scope. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param workspace_id: Required. The full Azure ID of the workspace to save - the data in - :type workspace_id: str - :param scope: Required. All the VMs in this scope will send their security - data to the mentioned workspace unless overridden by a setting with more - specific scope - :type scope: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'workspace_id': {'required': True}, - 'scope': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(WorkspaceSetting, self).__init__(**kwargs) - self.workspace_id = kwargs.get('workspace_id', None) - self.scope = kwargs.get('scope', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py deleted file mode 100644 index 95122f57b90e..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class WorkspaceSettingPaged(Paged): - """ - A paging container for iterating over a list of :class:`WorkspaceSetting ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[WorkspaceSetting]'} - } - - def __init__(self, *args, **kwargs): - - super(WorkspaceSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py deleted file mode 100644 index aaa1be0b59a9..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class WorkspaceSetting(Resource): - """Configures where to store the OMS agent data for workspaces under a scope. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param workspace_id: Required. The full Azure ID of the workspace to save - the data in - :type workspace_id: str - :param scope: Required. All the VMs in this scope will send their security - data to the mentioned workspace unless overridden by a setting with more - specific scope - :type scope: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'workspace_id': {'required': True}, - 'scope': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - } - - def __init__(self, *, workspace_id: str, scope: str, **kwargs) -> None: - super(WorkspaceSetting, self).__init__(**kwargs) - self.workspace_id = workspace_id - self.scope = scope diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index cc451ba3dd54..05d6e16ffdd6 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -9,14 +9,6 @@ # regenerated. # -------------------------------------------------------------------------- -from .pricings_operations import PricingsOperations -from .security_contacts_operations import SecurityContactsOperations -from .workspace_settings_operations import WorkspaceSettingsOperations -from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations -from .compliances_operations import CompliancesOperations -from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations -from .settings_operations import SettingsOperations -from .information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations import Operations from .locations_operations import LocationsOperations from .tasks_operations import TasksOperations @@ -28,14 +20,6 @@ from .allowed_connections_operations import AllowedConnectionsOperations __all__ = [ - 'PricingsOperations', - 'SecurityContactsOperations', - 'WorkspaceSettingsOperations', - 'AutoProvisioningSettingsOperations', - 'CompliancesOperations', - 'AdvancedThreatProtectionOperations', - 'SettingsOperations', - 'InformationProtectionPoliciesOperations', 'Operations', 'LocationsOperations', 'TasksOperations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py deleted file mode 100644 index 2bdef2916fbc..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class AdvancedThreatProtectionOperations(object): - """AdvancedThreatProtectionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - :ivar setting_name: Advanced Threat Protection setting name. Constant value: "current". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - self.setting_name = "current" - - self.config = config - - def get( - self, resource_id, custom_headers=None, raw=False, **operation_config): - """Gets the Advanced Threat Protection settings for the specified - resource. - - :param resource_id: The identifier of the resource. - :type resource_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AdvancedThreatProtectionSetting or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.security.models.AdvancedThreatProtectionSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'settingName': self._serialize.url("self.setting_name", self.setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AdvancedThreatProtectionSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'} - - def create( - self, resource_id, is_enabled=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates the Advanced Threat Protection settings on a - specified resource. - - :param resource_id: The identifier of the resource. - :type resource_id: str - :param is_enabled: Indicates whether Advanced Threat Protection is - enabled. - :type is_enabled: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AdvancedThreatProtectionSetting or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.security.models.AdvancedThreatProtectionSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - advanced_threat_protection_setting = models.AdvancedThreatProtectionSetting(is_enabled=is_enabled) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'settingName': self._serialize.url("self.setting_name", self.setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(advanced_threat_protection_setting, 'AdvancedThreatProtectionSetting') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AdvancedThreatProtectionSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py deleted file mode 100644 index 9d6eccd8d530..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py +++ /dev/null @@ -1,229 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class AutoProvisioningSettingsOperations(object): - """AutoProvisioningSettingsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Exposes the auto provisioning settings of the subscriptions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AutoProvisioningSetting - :rtype: - ~azure.mgmt.security.models.AutoProvisioningSettingPaged[~azure.mgmt.security.models.AutoProvisioningSetting] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.AutoProvisioningSettingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.AutoProvisioningSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings'} - - def get( - self, setting_name, custom_headers=None, raw=False, **operation_config): - """Details of a specific setting. - - :param setting_name: Auto provisioning setting key - :type setting_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AutoProvisioningSetting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.AutoProvisioningSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'settingName': self._serialize.url("setting_name", setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AutoProvisioningSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'} - - def create( - self, setting_name, auto_provision, custom_headers=None, raw=False, **operation_config): - """Details of a specific setting. - - :param setting_name: Auto provisioning setting key - :type setting_name: str - :param auto_provision: Describes what kind of security agent - provisioning action to take. Possible values include: 'On', 'Off' - :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AutoProvisioningSetting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.AutoProvisioningSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - setting = models.AutoProvisioningSetting(auto_provision=auto_provision) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'settingName': self._serialize.url("setting_name", setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(setting, 'AutoProvisioningSetting') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AutoProvisioningSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py deleted file mode 100644 index 3edc73a4fc32..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py +++ /dev/null @@ -1,169 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class CompliancesOperations(object): - """CompliancesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def list( - self, scope, custom_headers=None, raw=False, **operation_config): - """The Compliance scores of the specific management group. - - :param scope: Scope of the query, can be subscription - (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management - group (/providers/Microsoft.Management/managementGroups/mgName). - :type scope: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Compliance - :rtype: - ~azure.mgmt.security.models.CompliancePaged[~azure.mgmt.security.models.Compliance] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.CompliancePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.CompliancePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.Security/compliances'} - - def get( - self, scope, compliance_name, custom_headers=None, raw=False, **operation_config): - """Details of a specific Compliance. - - :param scope: Scope of the query, can be subscription - (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management - group (/providers/Microsoft.Management/managementGroups/mgName). - :type scope: str - :param compliance_name: name of the Compliance - :type compliance_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Compliance or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Compliance or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'complianceName': self._serialize.url("compliance_name", compliance_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Compliance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.Security/compliances/{complianceName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py deleted file mode 100644 index d4c5fe7329b4..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class InformationProtectionPoliciesOperations(object): - """InformationProtectionPoliciesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def get( - self, scope, information_protection_policy_name, custom_headers=None, raw=False, **operation_config): - """Details of the information protection policy. - - :param scope: Scope of the query, can be subscription - (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management - group (/providers/Microsoft.Management/managementGroups/mgName). - :type scope: str - :param information_protection_policy_name: Name of the information - protection policy. Possible values include: 'effective', 'custom' - :type information_protection_policy_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: InformationProtectionPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'informationProtectionPolicyName': self._serialize.url("information_protection_policy_name", information_protection_policy_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InformationProtectionPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}'} - - def create_or_update( - self, scope, information_protection_policy_name, custom_headers=None, raw=False, **operation_config): - """Details of the information protection policy. - - :param scope: Scope of the query, can be subscription - (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management - group (/providers/Microsoft.Management/managementGroups/mgName). - :type scope: str - :param information_protection_policy_name: Name of the information - protection policy. Possible values include: 'effective', 'custom' - :type information_protection_policy_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: InformationProtectionPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'informationProtectionPolicyName': self._serialize.url("information_protection_policy_name", information_protection_policy_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InformationProtectionPolicy', response) - if response.status_code == 201: - deserialized = self._deserialize('InformationProtectionPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}'} - - def list( - self, scope, custom_headers=None, raw=False, **operation_config): - """Information protection policies of a specific management group. - - :param scope: Scope of the query, can be subscription - (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management - group (/providers/Microsoft.Management/managementGroups/mgName). - :type scope: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of InformationProtectionPolicy - :rtype: - ~azure.mgmt.security.models.InformationProtectionPolicyPaged[~azure.mgmt.security.models.InformationProtectionPolicy] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.InformationProtectionPolicyPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.InformationProtectionPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py deleted file mode 100644 index 60cc30172f7e..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py +++ /dev/null @@ -1,433 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PricingsOperations(object): - """PricingsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Security pricing configurations in the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Pricing - :rtype: - ~azure.mgmt.security.models.PricingPaged[~azure.mgmt.security.models.Pricing] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.PricingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PricingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Security pricing configurations in the resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Pricing - :rtype: - ~azure.mgmt.security.models.PricingPaged[~azure.mgmt.security.models.Pricing] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.PricingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PricingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings'} - - def get_subscription_pricing( - self, pricing_name, custom_headers=None, raw=False, **operation_config): - """Security pricing configuration in the subscriptionSecurity pricing - configuration in the subscription. - - :param pricing_name: name of the pricing configuration - :type pricing_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Pricing or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Pricing or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_subscription_pricing.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Pricing', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_subscription_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} - - def update_subscription_pricing( - self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): - """Security pricing configuration in the subscription. - - :param pricing_name: name of the pricing configuration - :type pricing_name: str - :param pricing_tier: Pricing tier type. Possible values include: - 'Free', 'Standard' - :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Pricing or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Pricing or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - pricing = models.Pricing(pricing_tier=pricing_tier) - - # Construct URL - url = self.update_subscription_pricing.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(pricing, 'Pricing') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Pricing', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_subscription_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} - - def get_resource_group_pricing( - self, resource_group_name, pricing_name, custom_headers=None, raw=False, **operation_config): - """Security pricing configuration in the resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param pricing_name: name of the pricing configuration - :type pricing_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Pricing or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Pricing or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_resource_group_pricing.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Pricing', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} - - def create_or_update_resource_group_pricing( - self, resource_group_name, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): - """Security pricing configuration in the resource group. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param pricing_name: name of the pricing configuration - :type pricing_name: str - :param pricing_tier: Pricing tier type. Possible values include: - 'Free', 'Standard' - :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Pricing or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Pricing or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - pricing = models.Pricing(pricing_tier=pricing_tier) - - # Construct URL - url = self.create_or_update_resource_group_pricing.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(pricing, 'Pricing') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Pricing', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py deleted file mode 100644 index 9a1c12a66205..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py +++ /dev/null @@ -1,341 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class SecurityContactsOperations(object): - """SecurityContactsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Security contact configurations for the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SecurityContact - :rtype: - ~azure.mgmt.security.models.SecurityContactPaged[~azure.mgmt.security.models.SecurityContact] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.SecurityContactPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SecurityContactPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts'} - - def get( - self, security_contact_name, custom_headers=None, raw=False, **operation_config): - """Security contact configurations for the subscription. - - :param security_contact_name: Name of the security contact object - :type security_contact_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SecurityContact or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityContact or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SecurityContact', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} - - def create( - self, security_contact_name, security_contact, custom_headers=None, raw=False, **operation_config): - """Security contact configurations for the subscription. - - :param security_contact_name: Name of the security contact object - :type security_contact_name: str - :param security_contact: Security contact object - :type security_contact: ~azure.mgmt.security.models.SecurityContact - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SecurityContact or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityContact or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(security_contact, 'SecurityContact') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SecurityContact', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} - - def delete( - self, security_contact_name, custom_headers=None, raw=False, **operation_config): - """Security contact configurations for the subscription. - - :param security_contact_name: Name of the security contact object - :type security_contact_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} - - def update( - self, security_contact_name, security_contact, custom_headers=None, raw=False, **operation_config): - """Security contact configurations for the subscription. - - :param security_contact_name: Name of the security contact object - :type security_contact_name: str - :param security_contact: Security contact object - :type security_contact: ~azure.mgmt.security.models.SecurityContact - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SecurityContact or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityContact or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(security_contact, 'SecurityContact') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SecurityContact', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py deleted file mode 100644 index 6aef42b410e1..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class SettingsOperations(object): - """SettingsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Settings about different configurations in security center. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Setting - :rtype: - ~azure.mgmt.security.models.SettingPaged[~azure.mgmt.security.models.Setting] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.SettingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SettingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings'} - - def get( - self, setting_name, custom_headers=None, raw=False, **operation_config): - """Settings of different configurations in security center. - - :param setting_name: Name of setting: (MCAS/WDATP). Possible values - include: 'MCAS', 'WDATP' - :type setting_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Setting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Setting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'settingName': self._serialize.url("setting_name", setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Setting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} - - def update( - self, setting_name, kind, custom_headers=None, raw=False, **operation_config): - """updating settings about different configurations in security center. - - :param setting_name: Name of setting: (MCAS/WDATP). Possible values - include: 'MCAS', 'WDATP' - :type setting_name: str - :param kind: the kind of the settings string (DataExportSetting). - Possible values include: 'DataExportSetting', - 'AlertSuppressionSetting' - :type kind: str or ~azure.mgmt.security.models.SettingKind - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Setting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Setting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - setting = models.Setting(kind=kind) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'settingName': self._serialize.url("setting_name", setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(setting, 'Setting') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Setting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py deleted file mode 100644 index 7c25fa3c51ab..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py +++ /dev/null @@ -1,361 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class WorkspaceSettingsOperations(object): - """WorkspaceSettingsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-08-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Settings about where we should store your security data and logs. If - the result is empty, it means that no custom-workspace configuration - was set. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of WorkspaceSetting - :rtype: - ~azure.mgmt.security.models.WorkspaceSettingPaged[~azure.mgmt.security.models.WorkspaceSetting] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.WorkspaceSettingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.WorkspaceSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings'} - - def get( - self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): - """Settings about where we should store your security data and logs. If - the result is empty, it means that no custom-workspace configuration - was set. - - :param workspace_setting_name: Name of the security setting - :type workspace_setting_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: WorkspaceSetting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.WorkspaceSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('WorkspaceSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} - - def create( - self, workspace_setting_name, workspace_id, scope, custom_headers=None, raw=False, **operation_config): - """creating settings about where we should store your security data and - logs. - - :param workspace_setting_name: Name of the security setting - :type workspace_setting_name: str - :param workspace_id: The full Azure ID of the workspace to save the - data in - :type workspace_id: str - :param scope: All the VMs in this scope will send their security data - to the mentioned workspace unless overridden by a setting with more - specific scope - :type scope: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: WorkspaceSetting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.WorkspaceSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - workspace_setting = models.WorkspaceSetting(workspace_id=workspace_id, scope=scope) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(workspace_setting, 'WorkspaceSetting') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('WorkspaceSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} - - def update( - self, workspace_setting_name, workspace_id, scope, custom_headers=None, raw=False, **operation_config): - """Settings about where we should store your security data and logs. - - :param workspace_setting_name: Name of the security setting - :type workspace_setting_name: str - :param workspace_id: The full Azure ID of the workspace to save the - data in - :type workspace_id: str - :param scope: All the VMs in this scope will send their security data - to the mentioned workspace unless overridden by a setting with more - specific scope - :type scope: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: WorkspaceSetting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.WorkspaceSetting or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - workspace_setting = models.WorkspaceSetting(workspace_id=workspace_id, scope=scope) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(workspace_setting, 'WorkspaceSetting') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('WorkspaceSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} - - def delete( - self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): - """Deletes the custom workspace settings for this subscription. new VMs - will report to the default workspace. - - :param workspace_setting_name: Name of the security setting - :type workspace_setting_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index 4a70b5762f4f..51764b9cba3b 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -13,14 +13,6 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from .operations.pricings_operations import PricingsOperations -from .operations.security_contacts_operations import SecurityContactsOperations -from .operations.workspace_settings_operations import WorkspaceSettingsOperations -from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations -from .operations.compliances_operations import CompliancesOperations -from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations -from .operations.settings_operations import SettingsOperations -from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations.operations import Operations from .operations.locations_operations import LocationsOperations from .operations.tasks_operations import TasksOperations @@ -41,23 +33,23 @@ class SecurityCenterConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Azure subscription ID - :type subscription_id: str :param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations :type asc_location: str + :param subscription_id: Azure subscription ID + :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, asc_location, base_url=None): + self, credentials, asc_location, subscription_id, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") if asc_location is None: raise ValueError("Parameter 'asc_location' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -67,8 +59,8 @@ def __init__( self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials - self.subscription_id = subscription_id self.asc_location = asc_location + self.subscription_id = subscription_id class SecurityCenter(SDKClient): @@ -77,22 +69,6 @@ class SecurityCenter(SDKClient): :ivar config: Configuration for client. :vartype config: SecurityCenterConfiguration - :ivar pricings: Pricings operations - :vartype pricings: azure.mgmt.security.operations.PricingsOperations - :ivar security_contacts: SecurityContacts operations - :vartype security_contacts: azure.mgmt.security.operations.SecurityContactsOperations - :ivar workspace_settings: WorkspaceSettings operations - :vartype workspace_settings: azure.mgmt.security.operations.WorkspaceSettingsOperations - :ivar auto_provisioning_settings: AutoProvisioningSettings operations - :vartype auto_provisioning_settings: azure.mgmt.security.operations.AutoProvisioningSettingsOperations - :ivar compliances: Compliances operations - :vartype compliances: azure.mgmt.security.operations.CompliancesOperations - :ivar advanced_threat_protection: AdvancedThreatProtection operations - :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations - :ivar settings: Settings operations - :vartype settings: azure.mgmt.security.operations.SettingsOperations - :ivar information_protection_policies: InformationProtectionPolicies operations - :vartype information_protection_policies: azure.mgmt.security.operations.InformationProtectionPoliciesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.security.operations.Operations :ivar locations: Locations operations @@ -115,40 +91,25 @@ class SecurityCenter(SDKClient): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Azure subscription ID - :type subscription_id: str :param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations :type asc_location: str + :param subscription_id: Azure subscription ID + :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, asc_location, base_url=None): + self, credentials, asc_location, subscription_id, base_url=None): - self.config = SecurityCenterConfiguration(credentials, subscription_id, asc_location, base_url) + self.config = SecurityCenterConfiguration(credentials, asc_location, subscription_id, base_url) super(SecurityCenter, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2015-06-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.pricings = PricingsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.security_contacts = SecurityContactsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.workspace_settings = WorkspaceSettingsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.auto_provisioning_settings = AutoProvisioningSettingsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.compliances = CompliancesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.advanced_threat_protection = AdvancedThreatProtectionOperations( - self._client, self.config, self._serialize, self._deserialize) - self.settings = SettingsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.information_protection_policies = InformationProtectionPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.locations = LocationsOperations( From 47e5dc93d426bd819ce1f5a0d20859b0811af70e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 13 Feb 2019 13:04:06 +0000 Subject: [PATCH 2/2] Generated from 6cbbbe2e2e840c19e3f97332dbc44d0eb4049ce5 Azure Security Center - add missing 2017-08-01-preview api-version + bugfixes --- .../azure/mgmt/security/models/__init__.py | 78 +++- .../advanced_threat_protection_setting.py | 47 ++ .../advanced_threat_protection_setting_py3.py | 47 ++ .../models/auto_provisioning_setting.py | 50 ++ .../models/auto_provisioning_setting_paged.py | 27 ++ .../models/auto_provisioning_setting_py3.py | 50 ++ .../azure/mgmt/security/models/compliance.py | 62 +++ .../mgmt/security/models/compliance_paged.py | 27 ++ .../mgmt/security/models/compliance_py3.py | 62 +++ .../security/models/compliance_segment.py | 41 ++ .../security/models/compliance_segment_py3.py | 41 ++ .../security/models/data_export_setting.py | 55 +++ .../models/data_export_setting_py3.py | 55 +++ .../models/information_protection_keyword.py | 41 ++ .../information_protection_keyword_py3.py | 41 ++ .../models/information_protection_policy.py | 57 +++ .../information_protection_policy_paged.py | 27 ++ .../information_protection_policy_py3.py | 57 +++ .../mgmt/security/models/information_type.py | 50 ++ .../security/models/information_type_py3.py | 50 ++ .../azure/mgmt/security/models/pricing.py | 50 ++ .../mgmt/security/models/pricing_paged.py | 27 ++ .../azure/mgmt/security/models/pricing_py3.py | 50 ++ .../security/models/security_center_enums.py | 30 ++ .../mgmt/security/models/security_contact.py | 67 +++ .../security/models/security_contact_paged.py | 27 ++ .../security/models/security_contact_py3.py | 67 +++ .../mgmt/security/models/sensitivity_label.py | 36 ++ .../security/models/sensitivity_label_py3.py | 36 ++ .../azure/mgmt/security/models/setting.py | 50 ++ .../mgmt/security/models/setting_paged.py | 27 ++ .../azure/mgmt/security/models/setting_py3.py | 50 ++ .../mgmt/security/models/setting_resource.py | 51 +++ .../security/models/setting_resource_py3.py | 51 +++ .../mgmt/security/models/workspace_setting.py | 57 +++ .../models/workspace_setting_paged.py | 27 ++ .../security/models/workspace_setting_py3.py | 57 +++ .../mgmt/security/operations/__init__.py | 16 + .../advanced_threat_protection_operations.py | 171 +++++++ .../auto_provisioning_settings_operations.py | 229 +++++++++ .../operations/compliances_operations.py | 169 +++++++ ...ormation_protection_policies_operations.py | 236 ++++++++++ .../operations/pricings_operations.py | 433 ++++++++++++++++++ .../security_contacts_operations.py | 341 ++++++++++++++ .../operations/settings_operations.py | 232 ++++++++++ .../workspace_settings_operations.py | 361 +++++++++++++++ .../azure/mgmt/security/security_center.py | 61 ++- 47 files changed, 3957 insertions(+), 17 deletions(-) create mode 100644 azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_type.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/security_contact.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_resource.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index df5a1d53e437..7a8805c9b250 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -10,10 +10,24 @@ # -------------------------------------------------------------------------- try: + from .pricing_py3 import Pricing + from .asc_location_py3 import AscLocation + from .resource_py3 import Resource + from .security_contact_py3 import SecurityContact + from .workspace_setting_py3 import WorkspaceSetting + from .auto_provisioning_setting_py3 import AutoProvisioningSetting + from .compliance_segment_py3 import ComplianceSegment + from .compliance_py3 import Compliance + from .advanced_threat_protection_setting_py3 import AdvancedThreatProtectionSetting + from .setting_py3 import Setting + from .data_export_setting_py3 import DataExportSetting + from .setting_resource_py3 import SettingResource + from .sensitivity_label_py3 import SensitivityLabel + from .information_protection_keyword_py3 import InformationProtectionKeyword + from .information_type_py3 import InformationType + from .information_protection_policy_py3 import InformationProtectionPolicy from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation - from .resource_py3 import Resource - from .asc_location_py3 import AscLocation from .security_task_parameters_py3 import SecurityTaskParameters from .security_task_py3 import SecurityTask from .alert_entity_py3 import AlertEntity @@ -50,10 +64,24 @@ from .connectable_resource_py3 import ConnectableResource from .allowed_connections_resource_py3 import AllowedConnectionsResource except (SyntaxError, ImportError): + from .pricing import Pricing + from .asc_location import AscLocation + from .resource import Resource + from .security_contact import SecurityContact + from .workspace_setting import WorkspaceSetting + from .auto_provisioning_setting import AutoProvisioningSetting + from .compliance_segment import ComplianceSegment + from .compliance import Compliance + from .advanced_threat_protection_setting import AdvancedThreatProtectionSetting + from .setting import Setting + from .data_export_setting import DataExportSetting + from .setting_resource import SettingResource + from .sensitivity_label import SensitivityLabel + from .information_protection_keyword import InformationProtectionKeyword + from .information_type import InformationType + from .information_protection_policy import InformationProtectionPolicy from .operation_display import OperationDisplay from .operation import Operation - from .resource import Resource - from .asc_location import AscLocation from .security_task_parameters import SecurityTaskParameters from .security_task import SecurityTask from .alert_entity import AlertEntity @@ -89,6 +117,13 @@ from .connected_resource import ConnectedResource from .connectable_resource import ConnectableResource from .allowed_connections_resource import AllowedConnectionsResource +from .pricing_paged import PricingPaged +from .security_contact_paged import SecurityContactPaged +from .workspace_setting_paged import WorkspaceSettingPaged +from .auto_provisioning_setting_paged import AutoProvisioningSettingPaged +from .compliance_paged import CompliancePaged +from .setting_paged import SettingPaged +from .information_protection_policy_paged import InformationProtectionPolicyPaged from .operation_paged import OperationPaged from .asc_location_paged import AscLocationPaged from .security_task_paged import SecurityTaskPaged @@ -99,6 +134,11 @@ from .topology_resource_paged import TopologyResourcePaged from .allowed_connections_resource_paged import AllowedConnectionsResourcePaged from .security_center_enums import ( + PricingTier, + AlertNotifications, + AlertsToAdmins, + AutoProvision, + SettingKind, ReportedSeverity, SecurityFamily, Protocol, @@ -110,10 +150,24 @@ ) __all__ = [ + 'Pricing', + 'AscLocation', + 'Resource', + 'SecurityContact', + 'WorkspaceSetting', + 'AutoProvisioningSetting', + 'ComplianceSegment', + 'Compliance', + 'AdvancedThreatProtectionSetting', + 'Setting', + 'DataExportSetting', + 'SettingResource', + 'SensitivityLabel', + 'InformationProtectionKeyword', + 'InformationType', + 'InformationProtectionPolicy', 'OperationDisplay', 'Operation', - 'Resource', - 'AscLocation', 'SecurityTaskParameters', 'SecurityTask', 'AlertEntity', @@ -149,6 +203,13 @@ 'ConnectedResource', 'ConnectableResource', 'AllowedConnectionsResource', + 'PricingPaged', + 'SecurityContactPaged', + 'WorkspaceSettingPaged', + 'AutoProvisioningSettingPaged', + 'CompliancePaged', + 'SettingPaged', + 'InformationProtectionPolicyPaged', 'OperationPaged', 'AscLocationPaged', 'SecurityTaskPaged', @@ -158,6 +219,11 @@ 'ExternalSecuritySolutionPaged', 'TopologyResourcePaged', 'AllowedConnectionsResourcePaged', + 'PricingTier', + 'AlertNotifications', + 'AlertsToAdmins', + 'AutoProvision', + 'SettingKind', 'ReportedSeverity', 'SecurityFamily', 'Protocol', diff --git a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py new file mode 100644 index 000000000000..722352481320 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AdvancedThreatProtectionSetting(Resource): + """The Advanced Threat Protection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_enabled: Indicates whether Advanced Threat Protection is + enabled. + :type is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AdvancedThreatProtectionSetting, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py new file mode 100644 index 000000000000..66ed9c5fe2ec --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AdvancedThreatProtectionSetting(Resource): + """The Advanced Threat Protection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_enabled: Indicates whether Advanced Threat Protection is + enabled. + :type is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, *, is_enabled: bool=None, **kwargs) -> None: + super(AdvancedThreatProtectionSetting, self).__init__(**kwargs) + self.is_enabled = is_enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py new file mode 100644 index 000000000000..907869accb3d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AutoProvisioningSetting(Resource): + """Auto provisioning setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param auto_provision: Required. Describes what kind of security agent + provisioning action to take. Possible values include: 'On', 'Off' + :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'auto_provision': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'auto_provision': {'key': 'properties.autoProvision', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutoProvisioningSetting, self).__init__(**kwargs) + self.auto_provision = kwargs.get('auto_provision', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py new file mode 100644 index 000000000000..a618c42c075c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AutoProvisioningSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`AutoProvisioningSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AutoProvisioningSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(AutoProvisioningSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py new file mode 100644 index 000000000000..7c86b8da5c01 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AutoProvisioningSetting(Resource): + """Auto provisioning setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param auto_provision: Required. Describes what kind of security agent + provisioning action to take. Possible values include: 'On', 'Off' + :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'auto_provision': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'auto_provision': {'key': 'properties.autoProvision', 'type': 'str'}, + } + + def __init__(self, *, auto_provision, **kwargs) -> None: + super(AutoProvisioningSetting, self).__init__(**kwargs) + self.auto_provision = auto_provision diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance.py b/azure-mgmt-security/azure/mgmt/security/models/compliance.py new file mode 100644 index 000000000000..f515b35211bd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Compliance(Resource): + """Compliance of a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar assessment_timestamp_utc_date: The timestamp when the Compliance + calculation was conducted. + :vartype assessment_timestamp_utc_date: datetime + :ivar resource_count: The resource count of the given subscription for + which the Compliance calculation was conducted (needed for Management + Group Compliance calculation). + :vartype resource_count: int + :ivar assessment_result: An array of segment, which is the actually the + compliance assessment. + :vartype assessment_result: + list[~azure.mgmt.security.models.ComplianceSegment] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'assessment_timestamp_utc_date': {'readonly': True}, + 'resource_count': {'readonly': True}, + 'assessment_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'assessment_timestamp_utc_date': {'key': 'properties.assessmentTimestampUtcDate', 'type': 'iso-8601'}, + 'resource_count': {'key': 'properties.resourceCount', 'type': 'int'}, + 'assessment_result': {'key': 'properties.assessmentResult', 'type': '[ComplianceSegment]'}, + } + + def __init__(self, **kwargs): + super(Compliance, self).__init__(**kwargs) + self.assessment_timestamp_utc_date = None + self.resource_count = None + self.assessment_result = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py new file mode 100644 index 000000000000..4e2030375270 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class CompliancePaged(Paged): + """ + A paging container for iterating over a list of :class:`Compliance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Compliance]'} + } + + def __init__(self, *args, **kwargs): + + super(CompliancePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py new file mode 100644 index 000000000000..0e271a1351b4 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Compliance(Resource): + """Compliance of a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar assessment_timestamp_utc_date: The timestamp when the Compliance + calculation was conducted. + :vartype assessment_timestamp_utc_date: datetime + :ivar resource_count: The resource count of the given subscription for + which the Compliance calculation was conducted (needed for Management + Group Compliance calculation). + :vartype resource_count: int + :ivar assessment_result: An array of segment, which is the actually the + compliance assessment. + :vartype assessment_result: + list[~azure.mgmt.security.models.ComplianceSegment] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'assessment_timestamp_utc_date': {'readonly': True}, + 'resource_count': {'readonly': True}, + 'assessment_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'assessment_timestamp_utc_date': {'key': 'properties.assessmentTimestampUtcDate', 'type': 'iso-8601'}, + 'resource_count': {'key': 'properties.resourceCount', 'type': 'int'}, + 'assessment_result': {'key': 'properties.assessmentResult', 'type': '[ComplianceSegment]'}, + } + + def __init__(self, **kwargs) -> None: + super(Compliance, self).__init__(**kwargs) + self.assessment_timestamp_utc_date = None + self.resource_count = None + self.assessment_result = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py new file mode 100644 index 000000000000..ea23dc49c079 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComplianceSegment(Model): + """A segment of a compliance assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar segment_type: The segment type, e.g. compliant, non-compliance, + insufficient coverage, N/A, etc. + :vartype segment_type: str + :ivar percentage: The size (%) of the segment. + :vartype percentage: float + """ + + _validation = { + 'segment_type': {'readonly': True}, + 'percentage': {'readonly': True}, + } + + _attribute_map = { + 'segment_type': {'key': 'segmentType', 'type': 'str'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ComplianceSegment, self).__init__(**kwargs) + self.segment_type = None + self.percentage = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py new file mode 100644 index 000000000000..a819e7cde997 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComplianceSegment(Model): + """A segment of a compliance assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar segment_type: The segment type, e.g. compliant, non-compliance, + insufficient coverage, N/A, etc. + :vartype segment_type: str + :ivar percentage: The size (%) of the segment. + :vartype percentage: float + """ + + _validation = { + 'segment_type': {'readonly': True}, + 'percentage': {'readonly': True}, + } + + _attribute_map = { + 'segment_type': {'key': 'segmentType', 'type': 'str'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ComplianceSegment, self).__init__(**kwargs) + self.segment_type = None + self.percentage = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py new file mode 100644 index 000000000000..8c355e50e6ff --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .setting import Setting + + +class DataExportSetting(Setting): + """Represents a data export setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + :param enabled: Required. Is the data export setting is enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DataExportSetting, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py new file mode 100644 index 000000000000..05d8e11208fc --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .setting_py3 import Setting + + +class DataExportSetting(Setting): + """Represents a data export setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + :param enabled: Required. Is the data export setting is enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, kind, enabled: bool, **kwargs) -> None: + super(DataExportSetting, self).__init__(kind=kind, **kwargs) + self.enabled = enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py new file mode 100644 index 000000000000..b67a1d4cfbd1 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationProtectionKeyword(Model): + """The information type keyword. + + :param pattern: The keyword pattern. + :type pattern: str + :param custom: Indicates whether the keyword is custom or not. + :type custom: bool + :param can_be_numeric: Indicates whether the keyword can be applied on + numeric types or not. + :type can_be_numeric: bool + :param excluded: Indicates whether the keyword is excluded or not. + :type excluded: bool + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'can_be_numeric': {'key': 'canBeNumeric', 'type': 'bool'}, + 'excluded': {'key': 'excluded', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(InformationProtectionKeyword, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + self.custom = kwargs.get('custom', None) + self.can_be_numeric = kwargs.get('can_be_numeric', None) + self.excluded = kwargs.get('excluded', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py new file mode 100644 index 000000000000..52c424cd4452 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationProtectionKeyword(Model): + """The information type keyword. + + :param pattern: The keyword pattern. + :type pattern: str + :param custom: Indicates whether the keyword is custom or not. + :type custom: bool + :param can_be_numeric: Indicates whether the keyword can be applied on + numeric types or not. + :type can_be_numeric: bool + :param excluded: Indicates whether the keyword is excluded or not. + :type excluded: bool + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'can_be_numeric': {'key': 'canBeNumeric', 'type': 'bool'}, + 'excluded': {'key': 'excluded', 'type': 'bool'}, + } + + def __init__(self, *, pattern: str=None, custom: bool=None, can_be_numeric: bool=None, excluded: bool=None, **kwargs) -> None: + super(InformationProtectionKeyword, self).__init__(**kwargs) + self.pattern = pattern + self.custom = custom + self.can_be_numeric = can_be_numeric + self.excluded = excluded diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py new file mode 100644 index 000000000000..c430a8605127 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class InformationProtectionPolicy(Resource): + """Information protection policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar last_modified_utc: Describes the last UTC time the policy was + modified. + :vartype last_modified_utc: datetime + :param labels: Dictionary of sensitivity labels. + :type labels: dict[str, ~azure.mgmt.security.models.SensitivityLabel] + :param information_types: The sensitivity information types. + :type information_types: dict[str, + ~azure.mgmt.security.models.InformationType] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_utc': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'iso-8601'}, + 'labels': {'key': 'properties.labels', 'type': '{SensitivityLabel}'}, + 'information_types': {'key': 'properties.informationTypes', 'type': '{InformationType}'}, + } + + def __init__(self, **kwargs): + super(InformationProtectionPolicy, self).__init__(**kwargs) + self.last_modified_utc = None + self.labels = kwargs.get('labels', None) + self.information_types = kwargs.get('information_types', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py new file mode 100644 index 000000000000..807d040d4f4b --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class InformationProtectionPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`InformationProtectionPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[InformationProtectionPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(InformationProtectionPolicyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py new file mode 100644 index 000000000000..e07676bb0d27 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class InformationProtectionPolicy(Resource): + """Information protection policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar last_modified_utc: Describes the last UTC time the policy was + modified. + :vartype last_modified_utc: datetime + :param labels: Dictionary of sensitivity labels. + :type labels: dict[str, ~azure.mgmt.security.models.SensitivityLabel] + :param information_types: The sensitivity information types. + :type information_types: dict[str, + ~azure.mgmt.security.models.InformationType] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_utc': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'iso-8601'}, + 'labels': {'key': 'properties.labels', 'type': '{SensitivityLabel}'}, + 'information_types': {'key': 'properties.informationTypes', 'type': '{InformationType}'}, + } + + def __init__(self, *, labels=None, information_types=None, **kwargs) -> None: + super(InformationProtectionPolicy, self).__init__(**kwargs) + self.last_modified_utc = None + self.labels = labels + self.information_types = information_types diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_type.py b/azure-mgmt-security/azure/mgmt/security/models/information_type.py new file mode 100644 index 000000000000..df77e7c1ff65 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_type.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationType(Model): + """The information type. + + :param display_name: The name of the information type. + :type display_name: str + :param order: The order of the information type. + :type order: float + :param recommended_label_id: The recommended label id to be associated + with this information type. + :type recommended_label_id: str + :param enabled: Indicates whether the information type is enabled or not. + :type enabled: bool + :param custom: Indicates whether the information type is custom or not. + :type custom: bool + :param keywords: The information type keywords. + :type keywords: + list[~azure.mgmt.security.models.InformationProtectionKeyword] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'recommended_label_id': {'key': 'recommendedLabelId', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'keywords': {'key': 'keywords', 'type': '[InformationProtectionKeyword]'}, + } + + def __init__(self, **kwargs): + super(InformationType, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.recommended_label_id = kwargs.get('recommended_label_id', None) + self.enabled = kwargs.get('enabled', None) + self.custom = kwargs.get('custom', None) + self.keywords = kwargs.get('keywords', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py new file mode 100644 index 000000000000..b8b1ab434c82 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationType(Model): + """The information type. + + :param display_name: The name of the information type. + :type display_name: str + :param order: The order of the information type. + :type order: float + :param recommended_label_id: The recommended label id to be associated + with this information type. + :type recommended_label_id: str + :param enabled: Indicates whether the information type is enabled or not. + :type enabled: bool + :param custom: Indicates whether the information type is custom or not. + :type custom: bool + :param keywords: The information type keywords. + :type keywords: + list[~azure.mgmt.security.models.InformationProtectionKeyword] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'recommended_label_id': {'key': 'recommendedLabelId', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'keywords': {'key': 'keywords', 'type': '[InformationProtectionKeyword]'}, + } + + def __init__(self, *, display_name: str=None, order: float=None, recommended_label_id: str=None, enabled: bool=None, custom: bool=None, keywords=None, **kwargs) -> None: + super(InformationType, self).__init__(**kwargs) + self.display_name = display_name + self.order = order + self.recommended_label_id = recommended_label_id + self.enabled = enabled + self.custom = custom + self.keywords = keywords diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing.py b/azure-mgmt-security/azure/mgmt/security/models/pricing.py new file mode 100644 index 000000000000..320e3dc9e4dc --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Pricing(Resource): + """Pricing tier will be applied for the scope based on the resource ID. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param pricing_tier: Required. Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'pricing_tier': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Pricing, self).__init__(**kwargs) + self.pricing_tier = kwargs.get('pricing_tier', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py new file mode 100644 index 000000000000..09eee4ab69dd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PricingPaged(Paged): + """ + A paging container for iterating over a list of :class:`Pricing ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Pricing]'} + } + + def __init__(self, *args, **kwargs): + + super(PricingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py new file mode 100644 index 000000000000..25001e835a78 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Pricing(Resource): + """Pricing tier will be applied for the scope based on the resource ID. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param pricing_tier: Required. Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'pricing_tier': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, + } + + def __init__(self, *, pricing_tier, **kwargs) -> None: + super(Pricing, self).__init__(**kwargs) + self.pricing_tier = pricing_tier diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py index 018d83a94039..3f208a7cddd8 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -12,6 +12,36 @@ from enum import Enum +class PricingTier(str, Enum): + + free = "Free" #: Get free Azure security center experience with basic security features + standard = "Standard" #: Get the standard Azure security center experience with advanced security features + + +class AlertNotifications(str, Enum): + + on = "On" #: Get notifications on new alerts + off = "Off" #: Don't get notifications on new alerts + + +class AlertsToAdmins(str, Enum): + + on = "On" #: Send notification on new alerts to the subscription's admins + off = "Off" #: Don't send notification on new alerts to the subscription's admins + + +class AutoProvision(str, Enum): + + on = "On" #: Install missing security agent on VMs automatically + off = "Off" #: Do not install security agent on the VMs automatically + + +class SettingKind(str, Enum): + + data_export_setting = "DataExportSetting" + alert_suppression_setting = "AlertSuppressionSetting" + + class ReportedSeverity(str, Enum): silent = "Silent" diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact.py new file mode 100644 index 000000000000..43926670b0ec --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_contact.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class SecurityContact(Resource): + """Contact details for security issues. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param email: Required. The email of this security contact + :type email: str + :param phone: The phone number of this security contact + :type phone: str + :param alert_notifications: Required. Whether to send security alerts + notifications to the security contact. Possible values include: 'On', + 'Off' + :type alert_notifications: str or + ~azure.mgmt.security.models.AlertNotifications + :param alerts_to_admins: Required. Whether to send security alerts + notifications to subscription admins. Possible values include: 'On', 'Off' + :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'email': {'required': True}, + 'alert_notifications': {'required': True}, + 'alerts_to_admins': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, + 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityContact, self).__init__(**kwargs) + self.email = kwargs.get('email', None) + self.phone = kwargs.get('phone', None) + self.alert_notifications = kwargs.get('alert_notifications', None) + self.alerts_to_admins = kwargs.get('alerts_to_admins', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py new file mode 100644 index 000000000000..a422f9bd58b7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SecurityContactPaged(Paged): + """ + A paging container for iterating over a list of :class:`SecurityContact ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecurityContact]'} + } + + def __init__(self, *args, **kwargs): + + super(SecurityContactPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py new file mode 100644 index 000000000000..6a78f995545a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class SecurityContact(Resource): + """Contact details for security issues. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param email: Required. The email of this security contact + :type email: str + :param phone: The phone number of this security contact + :type phone: str + :param alert_notifications: Required. Whether to send security alerts + notifications to the security contact. Possible values include: 'On', + 'Off' + :type alert_notifications: str or + ~azure.mgmt.security.models.AlertNotifications + :param alerts_to_admins: Required. Whether to send security alerts + notifications to subscription admins. Possible values include: 'On', 'Off' + :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'email': {'required': True}, + 'alert_notifications': {'required': True}, + 'alerts_to_admins': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, + 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + } + + def __init__(self, *, email: str, alert_notifications, alerts_to_admins, phone: str=None, **kwargs) -> None: + super(SecurityContact, self).__init__(**kwargs) + self.email = email + self.phone = phone + self.alert_notifications = alert_notifications + self.alerts_to_admins = alerts_to_admins diff --git a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py new file mode 100644 index 000000000000..09fd4a0bee30 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SensitivityLabel(Model): + """The sensitivity label. + + :param display_name: The name of the sensitivity label. + :type display_name: str + :param order: The order of the sensitivity label. + :type order: float + :param enabled: Indicates whether the label is enabled or not. + :type enabled: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SensitivityLabel, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py new file mode 100644 index 000000000000..79b0766f48c8 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SensitivityLabel(Model): + """The sensitivity label. + + :param display_name: The name of the sensitivity label. + :type display_name: str + :param order: The order of the sensitivity label. + :type order: float + :param enabled: Indicates whether the label is enabled or not. + :type enabled: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, display_name: str=None, order: float=None, enabled: bool=None, **kwargs) -> None: + super(SensitivityLabel, self).__init__(**kwargs) + self.display_name = display_name + self.order = order + self.enabled = enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting.py b/azure-mgmt-security/azure/mgmt/security/models/setting.py new file mode 100644 index 000000000000..9dd2c8f9944c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .setting_resource import SettingResource + + +class Setting(SettingResource): + """Represents a security setting in Azure Security Center. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Setting, self).__init__(**kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py new file mode 100644 index 000000000000..5ab8b2585b4a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`Setting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Setting]'} + } + + def __init__(self, *args, **kwargs): + + super(SettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py new file mode 100644 index 000000000000..0611d4ebdd49 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .setting_resource_py3 import SettingResource + + +class Setting(SettingResource): + """Represents a security setting in Azure Security Center. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind, **kwargs) -> None: + super(Setting, self).__init__(kind=kind, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py b/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py new file mode 100644 index 000000000000..d20bda7cab66 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class SettingResource(Resource): + """The kind of the security setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SettingResource, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py new file mode 100644 index 000000000000..4feeff7166c5 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class SettingResource(Resource): + """The kind of the security setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind, **kwargs) -> None: + super(SettingResource, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py new file mode 100644 index 000000000000..327a5b9d8897 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class WorkspaceSetting(Resource): + """Configures where to store the OMS agent data for workspaces under a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param workspace_id: Required. The full Azure ID of the workspace to save + the data in + :type workspace_id: str + :param scope: Required. All the VMs in this scope will send their security + data to the mentioned workspace unless overridden by a setting with more + specific scope + :type scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workspace_id': {'required': True}, + 'scope': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceSetting, self).__init__(**kwargs) + self.workspace_id = kwargs.get('workspace_id', None) + self.scope = kwargs.get('scope', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py new file mode 100644 index 000000000000..95122f57b90e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WorkspaceSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkspaceSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkspaceSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkspaceSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py new file mode 100644 index 000000000000..aaa1be0b59a9 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class WorkspaceSetting(Resource): + """Configures where to store the OMS agent data for workspaces under a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param workspace_id: Required. The full Azure ID of the workspace to save + the data in + :type workspace_id: str + :param scope: Required. All the VMs in this scope will send their security + data to the mentioned workspace unless overridden by a setting with more + specific scope + :type scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workspace_id': {'required': True}, + 'scope': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, *, workspace_id: str, scope: str, **kwargs) -> None: + super(WorkspaceSetting, self).__init__(**kwargs) + self.workspace_id = workspace_id + self.scope = scope diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 05d6e16ffdd6..cc451ba3dd54 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -9,6 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- +from .pricings_operations import PricingsOperations +from .security_contacts_operations import SecurityContactsOperations +from .workspace_settings_operations import WorkspaceSettingsOperations +from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations +from .compliances_operations import CompliancesOperations +from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .settings_operations import SettingsOperations +from .information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations import Operations from .locations_operations import LocationsOperations from .tasks_operations import TasksOperations @@ -20,6 +28,14 @@ from .allowed_connections_operations import AllowedConnectionsOperations __all__ = [ + 'PricingsOperations', + 'SecurityContactsOperations', + 'WorkspaceSettingsOperations', + 'AutoProvisioningSettingsOperations', + 'CompliancesOperations', + 'AdvancedThreatProtectionOperations', + 'SettingsOperations', + 'InformationProtectionPoliciesOperations', 'Operations', 'LocationsOperations', 'TasksOperations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py new file mode 100644 index 000000000000..2bdef2916fbc --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py @@ -0,0 +1,171 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AdvancedThreatProtectionOperations(object): + """AdvancedThreatProtectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + :ivar setting_name: Advanced Threat Protection setting name. Constant value: "current". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + self.setting_name = "current" + + self.config = config + + def get( + self, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the Advanced Threat Protection settings for the specified + resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AdvancedThreatProtectionSetting or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.AdvancedThreatProtectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'settingName': self._serialize.url("self.setting_name", self.setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AdvancedThreatProtectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'} + + def create( + self, resource_id, is_enabled=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the Advanced Threat Protection settings on a + specified resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param is_enabled: Indicates whether Advanced Threat Protection is + enabled. + :type is_enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AdvancedThreatProtectionSetting or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.AdvancedThreatProtectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + advanced_threat_protection_setting = models.AdvancedThreatProtectionSetting(is_enabled=is_enabled) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'settingName': self._serialize.url("self.setting_name", self.setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(advanced_threat_protection_setting, 'AdvancedThreatProtectionSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AdvancedThreatProtectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py new file mode 100644 index 000000000000..9d6eccd8d530 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py @@ -0,0 +1,229 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AutoProvisioningSettingsOperations(object): + """AutoProvisioningSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Exposes the auto provisioning settings of the subscriptions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AutoProvisioningSetting + :rtype: + ~azure.mgmt.security.models.AutoProvisioningSettingPaged[~azure.mgmt.security.models.AutoProvisioningSetting] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AutoProvisioningSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutoProvisioningSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings'} + + def get( + self, setting_name, custom_headers=None, raw=False, **operation_config): + """Details of a specific setting. + + :param setting_name: Auto provisioning setting key + :type setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutoProvisioningSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AutoProvisioningSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutoProvisioningSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'} + + def create( + self, setting_name, auto_provision, custom_headers=None, raw=False, **operation_config): + """Details of a specific setting. + + :param setting_name: Auto provisioning setting key + :type setting_name: str + :param auto_provision: Describes what kind of security agent + provisioning action to take. Possible values include: 'On', 'Off' + :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutoProvisioningSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AutoProvisioningSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + setting = models.AutoProvisioningSetting(auto_provision=auto_provision) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(setting, 'AutoProvisioningSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutoProvisioningSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py new file mode 100644 index 000000000000..3edc73a4fc32 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CompliancesOperations(object): + """CompliancesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """The Compliance scores of the specific management group. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Compliance + :rtype: + ~azure.mgmt.security.models.CompliancePaged[~azure.mgmt.security.models.Compliance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.CompliancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CompliancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/compliances'} + + def get( + self, scope, compliance_name, custom_headers=None, raw=False, **operation_config): + """Details of a specific Compliance. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param compliance_name: name of the Compliance + :type compliance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Compliance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Compliance or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'complianceName': self._serialize.url("compliance_name", compliance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Compliance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/compliances/{complianceName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py new file mode 100644 index 000000000000..d4c5fe7329b4 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py @@ -0,0 +1,236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class InformationProtectionPoliciesOperations(object): + """InformationProtectionPoliciesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def get( + self, scope, information_protection_policy_name, custom_headers=None, raw=False, **operation_config): + """Details of the information protection policy. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param information_protection_policy_name: Name of the information + protection policy. Possible values include: 'effective', 'custom' + :type information_protection_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InformationProtectionPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'informationProtectionPolicyName': self._serialize.url("information_protection_policy_name", information_protection_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InformationProtectionPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}'} + + def create_or_update( + self, scope, information_protection_policy_name, custom_headers=None, raw=False, **operation_config): + """Details of the information protection policy. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param information_protection_policy_name: Name of the information + protection policy. Possible values include: 'effective', 'custom' + :type information_protection_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InformationProtectionPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'informationProtectionPolicyName': self._serialize.url("information_protection_policy_name", information_protection_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InformationProtectionPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('InformationProtectionPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}'} + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """Information protection policies of a specific management group. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of InformationProtectionPolicy + :rtype: + ~azure.mgmt.security.models.InformationProtectionPolicyPaged[~azure.mgmt.security.models.InformationProtectionPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.InformationProtectionPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InformationProtectionPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py new file mode 100644 index 000000000000..60cc30172f7e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py @@ -0,0 +1,433 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PricingsOperations(object): + """PricingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Security pricing configurations in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Pricing + :rtype: + ~azure.mgmt.security.models.PricingPaged[~azure.mgmt.security.models.Pricing] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PricingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PricingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Security pricing configurations in the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Pricing + :rtype: + ~azure.mgmt.security.models.PricingPaged[~azure.mgmt.security.models.Pricing] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PricingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PricingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings'} + + def get_subscription_pricing( + self, pricing_name, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the subscriptionSecurity pricing + configuration in the subscription. + + :param pricing_name: name of the pricing configuration + :type pricing_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_subscription_pricing.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} + + def update_subscription_pricing( + self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the subscription. + + :param pricing_name: name of the pricing configuration + :type pricing_name: str + :param pricing_tier: Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + pricing = models.Pricing(pricing_tier=pricing_tier) + + # Construct URL + url = self.update_subscription_pricing.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(pricing, 'Pricing') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_subscription_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} + + def get_resource_group_pricing( + self, resource_group_name, pricing_name, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param pricing_name: name of the pricing configuration + :type pricing_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_resource_group_pricing.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} + + def create_or_update_resource_group_pricing( + self, resource_group_name, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param pricing_name: name of the pricing configuration + :type pricing_name: str + :param pricing_tier: Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + pricing = models.Pricing(pricing_tier=pricing_tier) + + # Construct URL + url = self.create_or_update_resource_group_pricing.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(pricing, 'Pricing') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py new file mode 100644 index 000000000000..9a1c12a66205 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py @@ -0,0 +1,341 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SecurityContactsOperations(object): + """SecurityContactsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityContact + :rtype: + ~azure.mgmt.security.models.SecurityContactPaged[~azure.mgmt.security.models.SecurityContact] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityContactPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityContactPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts'} + + def get( + self, security_contact_name, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecurityContact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityContact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityContact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} + + def create( + self, security_contact_name, security_contact, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param security_contact: Security contact object + :type security_contact: ~azure.mgmt.security.models.SecurityContact + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecurityContact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityContact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(security_contact, 'SecurityContact') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityContact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} + + def delete( + self, security_contact_name, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} + + def update( + self, security_contact_name, security_contact, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param security_contact: Security contact object + :type security_contact: ~azure.mgmt.security.models.SecurityContact + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecurityContact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityContact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(security_contact, 'SecurityContact') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityContact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py new file mode 100644 index 000000000000..6aef42b410e1 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py @@ -0,0 +1,232 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SettingsOperations(object): + """SettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Settings about different configurations in security center. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Setting + :rtype: + ~azure.mgmt.security.models.SettingPaged[~azure.mgmt.security.models.Setting] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings'} + + def get( + self, setting_name, custom_headers=None, raw=False, **operation_config): + """Settings of different configurations in security center. + + :param setting_name: Name of setting: (MCAS/WDATP). Possible values + include: 'MCAS', 'WDATP' + :type setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Setting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Setting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Setting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} + + def update( + self, setting_name, kind, custom_headers=None, raw=False, **operation_config): + """updating settings about different configurations in security center. + + :param setting_name: Name of setting: (MCAS/WDATP). Possible values + include: 'MCAS', 'WDATP' + :type setting_name: str + :param kind: the kind of the settings string (DataExportSetting). + Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Setting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Setting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + setting = models.Setting(kind=kind) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(setting, 'Setting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Setting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py new file mode 100644 index 000000000000..7c25fa3c51ab --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py @@ -0,0 +1,361 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class WorkspaceSettingsOperations(object): + """WorkspaceSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Settings about where we should store your security data and logs. If + the result is empty, it means that no custom-workspace configuration + was set. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkspaceSetting + :rtype: + ~azure.mgmt.security.models.WorkspaceSettingPaged[~azure.mgmt.security.models.WorkspaceSetting] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.WorkspaceSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkspaceSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings'} + + def get( + self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): + """Settings about where we should store your security data and logs. If + the result is empty, it means that no custom-workspace configuration + was set. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkspaceSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.WorkspaceSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} + + def create( + self, workspace_setting_name, workspace_id, scope, custom_headers=None, raw=False, **operation_config): + """creating settings about where we should store your security data and + logs. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param workspace_id: The full Azure ID of the workspace to save the + data in + :type workspace_id: str + :param scope: All the VMs in this scope will send their security data + to the mentioned workspace unless overridden by a setting with more + specific scope + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkspaceSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.WorkspaceSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + workspace_setting = models.WorkspaceSetting(workspace_id=workspace_id, scope=scope) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workspace_setting, 'WorkspaceSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} + + def update( + self, workspace_setting_name, workspace_id, scope, custom_headers=None, raw=False, **operation_config): + """Settings about where we should store your security data and logs. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param workspace_id: The full Azure ID of the workspace to save the + data in + :type workspace_id: str + :param scope: All the VMs in this scope will send their security data + to the mentioned workspace unless overridden by a setting with more + specific scope + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkspaceSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.WorkspaceSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + workspace_setting = models.WorkspaceSetting(workspace_id=workspace_id, scope=scope) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workspace_setting, 'WorkspaceSetting') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} + + def delete( + self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): + """Deletes the custom workspace settings for this subscription. new VMs + will report to the default workspace. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index 51764b9cba3b..4a70b5762f4f 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -13,6 +13,14 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.pricings_operations import PricingsOperations +from .operations.security_contacts_operations import SecurityContactsOperations +from .operations.workspace_settings_operations import WorkspaceSettingsOperations +from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations +from .operations.compliances_operations import CompliancesOperations +from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .operations.settings_operations import SettingsOperations +from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations.operations import Operations from .operations.locations_operations import LocationsOperations from .operations.tasks_operations import TasksOperations @@ -33,23 +41,23 @@ class SecurityCenterConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` + :param subscription_id: Azure subscription ID + :type subscription_id: str :param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations :type asc_location: str - :param subscription_id: Azure subscription ID - :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, asc_location, subscription_id, base_url=None): + self, credentials, subscription_id, asc_location, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") - if asc_location is None: - raise ValueError("Parameter 'asc_location' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if asc_location is None: + raise ValueError("Parameter 'asc_location' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -59,8 +67,8 @@ def __init__( self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials - self.asc_location = asc_location self.subscription_id = subscription_id + self.asc_location = asc_location class SecurityCenter(SDKClient): @@ -69,6 +77,22 @@ class SecurityCenter(SDKClient): :ivar config: Configuration for client. :vartype config: SecurityCenterConfiguration + :ivar pricings: Pricings operations + :vartype pricings: azure.mgmt.security.operations.PricingsOperations + :ivar security_contacts: SecurityContacts operations + :vartype security_contacts: azure.mgmt.security.operations.SecurityContactsOperations + :ivar workspace_settings: WorkspaceSettings operations + :vartype workspace_settings: azure.mgmt.security.operations.WorkspaceSettingsOperations + :ivar auto_provisioning_settings: AutoProvisioningSettings operations + :vartype auto_provisioning_settings: azure.mgmt.security.operations.AutoProvisioningSettingsOperations + :ivar compliances: Compliances operations + :vartype compliances: azure.mgmt.security.operations.CompliancesOperations + :ivar advanced_threat_protection: AdvancedThreatProtection operations + :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations + :ivar settings: Settings operations + :vartype settings: azure.mgmt.security.operations.SettingsOperations + :ivar information_protection_policies: InformationProtectionPolicies operations + :vartype information_protection_policies: azure.mgmt.security.operations.InformationProtectionPoliciesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.security.operations.Operations :ivar locations: Locations operations @@ -91,25 +115,40 @@ class SecurityCenter(SDKClient): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` + :param subscription_id: Azure subscription ID + :type subscription_id: str :param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations :type asc_location: str - :param subscription_id: Azure subscription ID - :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, asc_location, subscription_id, base_url=None): + self, credentials, subscription_id, asc_location, base_url=None): - self.config = SecurityCenterConfiguration(credentials, asc_location, subscription_id, base_url) + self.config = SecurityCenterConfiguration(credentials, subscription_id, asc_location, base_url) super(SecurityCenter, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2015-06-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.pricings = PricingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.security_contacts = SecurityContactsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_settings = WorkspaceSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.auto_provisioning_settings = AutoProvisioningSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.compliances = CompliancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.advanced_threat_protection = AdvancedThreatProtectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.information_protection_policies = InformationProtectionPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.locations = LocationsOperations(