diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py index 4269289ed2ad..394ab63dd677 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -15,6 +15,23 @@ from .alert_rule_py3 import AlertRule from .alert_rule_kind1_py3 import AlertRuleKind1 from .scheduled_alert_rule_py3 import ScheduledAlertRule + from .data_connector_py3 import DataConnector + from .data_connector_kind1_py3 import DataConnectorKind1 + from .data_connector_context_id_py3 import DataConnectorContextId + from .office_data_connector_data_types_share_point_py3 import OfficeDataConnectorDataTypesSharePoint + from .office_data_connector_data_types_exchange_py3 import OfficeDataConnectorDataTypesExchange + from .office_data_connector_data_types_py3 import OfficeDataConnectorDataTypes + from .office_data_connector_py3 import OfficeDataConnector + from .ti_data_connector_data_types_indicators_py3 import TIDataConnectorDataTypesIndicators + from .ti_data_connector_data_types_py3 import TIDataConnectorDataTypes + from .ti_data_connector_py3 import TIDataConnector + from .aad_data_connector_py3 import AADDataConnector + from .asc_data_connector_py3 import ASCDataConnector + from .mcas_data_connector_py3 import MCASDataConnector + from .alerts_data_type_of_data_connector_alerts_py3 import AlertsDataTypeOfDataConnectorAlerts + from .alerts_data_type_of_data_connector_py3 import AlertsDataTypeOfDataConnector + from .data_connector_with_alerts_py3 import DataConnectorWithAlerts + from .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon from .resource_py3 import Resource except (SyntaxError, ImportError): from .operation_display import OperationDisplay @@ -22,13 +39,33 @@ from .alert_rule import AlertRule from .alert_rule_kind1 import AlertRuleKind1 from .scheduled_alert_rule import ScheduledAlertRule + from .data_connector import DataConnector + from .data_connector_kind1 import DataConnectorKind1 + from .data_connector_context_id import DataConnectorContextId + from .office_data_connector_data_types_share_point import OfficeDataConnectorDataTypesSharePoint + from .office_data_connector_data_types_exchange import OfficeDataConnectorDataTypesExchange + from .office_data_connector_data_types import OfficeDataConnectorDataTypes + from .office_data_connector import OfficeDataConnector + from .ti_data_connector_data_types_indicators import TIDataConnectorDataTypesIndicators + from .ti_data_connector_data_types import TIDataConnectorDataTypes + from .ti_data_connector import TIDataConnector + from .aad_data_connector import AADDataConnector + from .asc_data_connector import ASCDataConnector + from .mcas_data_connector import MCASDataConnector + from .alerts_data_type_of_data_connector_alerts import AlertsDataTypeOfDataConnectorAlerts + from .alerts_data_type_of_data_connector import AlertsDataTypeOfDataConnector + from .data_connector_with_alerts import DataConnectorWithAlerts + from .data_connector_data_type_common import DataConnectorDataTypeCommon from .resource import Resource from .operation_paged import OperationPaged from .alert_rule_paged import AlertRulePaged +from .data_connector_paged import DataConnectorPaged from .security_insights_enums import ( AlertRuleKind, Severity, TriggerOperator, + DataConnectorKind, + DataTypeState, ) __all__ = [ @@ -37,10 +74,30 @@ 'AlertRule', 'AlertRuleKind1', 'ScheduledAlertRule', + 'DataConnector', + 'DataConnectorKind1', + 'DataConnectorContextId', + 'OfficeDataConnectorDataTypesSharePoint', + 'OfficeDataConnectorDataTypesExchange', + 'OfficeDataConnectorDataTypes', + 'OfficeDataConnector', + 'TIDataConnectorDataTypesIndicators', + 'TIDataConnectorDataTypes', + 'TIDataConnector', + 'AADDataConnector', + 'ASCDataConnector', + 'MCASDataConnector', + 'AlertsDataTypeOfDataConnectorAlerts', + 'AlertsDataTypeOfDataConnector', + 'DataConnectorWithAlerts', + 'DataConnectorDataTypeCommon', 'Resource', 'OperationPaged', 'AlertRulePaged', + 'DataConnectorPaged', 'AlertRuleKind', 'Severity', 'TriggerOperator', + 'DataConnectorKind', + 'DataTypeState', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py new file mode 100644 index 000000000000..0af5abc053ab --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py @@ -0,0 +1,60 @@ +# 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 .data_connector_with_alerts import DataConnectorWithAlerts + + +class AADDataConnector(DataConnectorWithAlerts): + """Represents AAD (Azure Active Directory) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(AADDataConnector, self).__init__(**kwargs) + self.kind = 'AzureActiveDirectory' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py new file mode 100644 index 000000000000..2d2a0a618e3b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py @@ -0,0 +1,60 @@ +# 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 .data_connector_with_alerts_py3 import DataConnectorWithAlerts + + +class AADDataConnector(DataConnectorWithAlerts): + """Represents AAD (Azure Active Directory) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(AADDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + self.kind = 'AzureActiveDirectory' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py new file mode 100644 index 000000000000..36a5e58a48ad --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py @@ -0,0 +1,29 @@ +# 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 AlertsDataTypeOfDataConnector(Model): + """Alerts data type for data connectors. + + :param alerts: Alerts data type connection. + :type alerts: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnectorAlerts + """ + + _attribute_map = { + 'alerts': {'key': 'alerts', 'type': 'AlertsDataTypeOfDataConnectorAlerts'}, + } + + def __init__(self, **kwargs): + super(AlertsDataTypeOfDataConnector, self).__init__(**kwargs) + self.alerts = kwargs.get('alerts', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.py new file mode 100644 index 000000000000..534735b5faef --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class AlertsDataTypeOfDataConnectorAlerts(DataConnectorDataTypeCommon): + """Alerts data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AlertsDataTypeOfDataConnectorAlerts, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_py3.py new file mode 100644 index 000000000000..9ab513e28b34 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_py3.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class AlertsDataTypeOfDataConnectorAlerts(DataConnectorDataTypeCommon): + """Alerts data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(AlertsDataTypeOfDataConnectorAlerts, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py new file mode 100644 index 000000000000..df40d726ad58 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py @@ -0,0 +1,29 @@ +# 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 AlertsDataTypeOfDataConnector(Model): + """Alerts data type for data connectors. + + :param alerts: Alerts data type connection. + :type alerts: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnectorAlerts + """ + + _attribute_map = { + 'alerts': {'key': 'alerts', 'type': 'AlertsDataTypeOfDataConnectorAlerts'}, + } + + def __init__(self, *, alerts=None, **kwargs) -> None: + super(AlertsDataTypeOfDataConnector, self).__init__(**kwargs) + self.alerts = alerts diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py new file mode 100644 index 000000000000..326c886fe8b6 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py @@ -0,0 +1,60 @@ +# 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 .data_connector_with_alerts import DataConnectorWithAlerts + + +class ASCDataConnector(DataConnectorWithAlerts): + """Represents ASC (Azure Security Center) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(ASCDataConnector, self).__init__(**kwargs) + self.kind = 'AzureSecurityCenter' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py new file mode 100644 index 000000000000..c74146245a1d --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py @@ -0,0 +1,60 @@ +# 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 .data_connector_with_alerts_py3 import DataConnectorWithAlerts + + +class ASCDataConnector(DataConnectorWithAlerts): + """Represents ASC (Azure Security Center) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(ASCDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + self.kind = 'AzureSecurityCenter' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py new file mode 100644 index 000000000000..d6c8634a338d --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py @@ -0,0 +1,64 @@ +# 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 DataConnector(Model): + """Data connector. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OfficeDataConnector, TIDataConnector, + DataConnectorWithAlerts + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'DataConnectorWithAlerts': 'DataConnectorWithAlerts'} + } + + def __init__(self, **kwargs): + super(DataConnector, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.etag = kwargs.get('etag', None) + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py new file mode 100644 index 000000000000..593f5cddcfe5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py @@ -0,0 +1,29 @@ +# 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 DataConnectorContextId(Model): + """Describes an Azure resource with kind. + + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + """ + + _attribute_map = { + 'context_id': {'key': 'contextId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorContextId, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py new file mode 100644 index 000000000000..7b26fbf253cb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py @@ -0,0 +1,29 @@ +# 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 DataConnectorContextId(Model): + """Describes an Azure resource with kind. + + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + """ + + _attribute_map = { + 'context_id': {'key': 'contextId', 'type': 'str'}, + } + + def __init__(self, *, context_id: str=None, **kwargs) -> None: + super(DataConnectorContextId, self).__init__(**kwargs) + self.context_id = context_id diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py new file mode 100644 index 000000000000..91c0a49613f9 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py @@ -0,0 +1,29 @@ +# 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 DataConnectorDataTypeCommon(Model): + """Common field for data type in data connectors. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorDataTypeCommon, self).__init__(**kwargs) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py new file mode 100644 index 000000000000..33866464f222 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py @@ -0,0 +1,29 @@ +# 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 DataConnectorDataTypeCommon(Model): + """Common field for data type in data connectors. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(DataConnectorDataTypeCommon, self).__init__(**kwargs) + self.state = state diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py new file mode 100644 index 000000000000..acb1391b716b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py @@ -0,0 +1,30 @@ +# 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 DataConnectorKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the data connector. Possible values include: + 'AzureActiveDirectory', 'AzureSecurityCenter', + 'MicrosoftCloudAppSecurity', 'ThreatIntelligence', 'Office365' + :type kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py new file mode 100644 index 000000000000..1fc79470d356 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py @@ -0,0 +1,30 @@ +# 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 DataConnectorKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the data connector. Possible values include: + 'AzureActiveDirectory', 'AzureSecurityCenter', + 'MicrosoftCloudAppSecurity', 'ThreatIntelligence', 'Office365' + :type kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(DataConnectorKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_paged.py new file mode 100644 index 000000000000..b3929c84ac01 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_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 DataConnectorPaged(Paged): + """ + A paging container for iterating over a list of :class:`DataConnector ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataConnector]'} + } + + def __init__(self, *args, **kwargs): + + super(DataConnectorPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py new file mode 100644 index 000000000000..8b8782ff6de5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py @@ -0,0 +1,64 @@ +# 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 DataConnector(Model): + """Data connector. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OfficeDataConnector, TIDataConnector, + DataConnectorWithAlerts + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'DataConnectorWithAlerts': 'DataConnectorWithAlerts'} + } + + def __init__(self, *, etag: str=None, **kwargs) -> None: + super(DataConnector, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.etag = etag + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py new file mode 100644 index 000000000000..1b35258799b1 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py @@ -0,0 +1,69 @@ +# 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 .data_connector import DataConnector + + +class DataConnectorWithAlerts(DataConnector): + """Data connector with alerts data type. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AADDataConnector, ASCDataConnector, MCASDataConnector + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + _subtype_map = { + 'kind': {'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} + } + + def __init__(self, **kwargs): + super(DataConnectorWithAlerts, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) + self.data_types = kwargs.get('data_types', None) + self.kind = 'DataConnectorWithAlerts' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py new file mode 100644 index 000000000000..962cae013763 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py @@ -0,0 +1,69 @@ +# 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 .data_connector_py3 import DataConnector + + +class DataConnectorWithAlerts(DataConnector): + """Data connector with alerts data type. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AADDataConnector, ASCDataConnector, MCASDataConnector + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + _subtype_map = { + 'kind': {'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(DataConnectorWithAlerts, self).__init__(etag=etag, **kwargs) + self.context_id = context_id + self.data_types = data_types + self.kind = 'DataConnectorWithAlerts' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py new file mode 100644 index 000000000000..47e35b96e22e --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py @@ -0,0 +1,60 @@ +# 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 .data_connector_with_alerts import DataConnectorWithAlerts + + +class MCASDataConnector(DataConnectorWithAlerts): + """Represents MCAS (Microsoft Cloud App Security) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(MCASDataConnector, self).__init__(**kwargs) + self.kind = 'MicrosoftCloudAppSecurity' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py new file mode 100644 index 000000000000..f7d3007b934b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py @@ -0,0 +1,60 @@ +# 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 .data_connector_with_alerts_py3 import DataConnectorWithAlerts + + +class MCASDataConnector(DataConnectorWithAlerts): + """Represents MCAS (Microsoft Cloud App Security) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(MCASDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + self.kind = 'MicrosoftCloudAppSecurity' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py new file mode 100644 index 000000000000..d27ac1ced326 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.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 .data_connector import DataConnector + + +class OfficeDataConnector(DataConnector): + """Represents office data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'OfficeDataConnectorDataTypes'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnector, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) + self.data_types = kwargs.get('data_types', None) + self.kind = 'Office365' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.py new file mode 100644 index 000000000000..31885bab93ce --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.py @@ -0,0 +1,34 @@ +# 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 OfficeDataConnectorDataTypes(Model): + """The available data types for office data connector. + + :param share_point: SharePoint data type connection. + :type share_point: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint + :param exchange: Exchange data type connection. + :type exchange: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange + """ + + _attribute_map = { + 'share_point': {'key': 'sharePoint', 'type': 'OfficeDataConnectorDataTypesSharePoint'}, + 'exchange': {'key': 'exchange', 'type': 'OfficeDataConnectorDataTypesExchange'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnectorDataTypes, self).__init__(**kwargs) + self.share_point = kwargs.get('share_point', None) + self.exchange = kwargs.get('exchange', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.py new file mode 100644 index 000000000000..0f0d4e362449 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon): + """Exchange data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnectorDataTypesExchange, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_py3.py new file mode 100644 index 000000000000..a538d5111466 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_py3.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon): + """Exchange data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(OfficeDataConnectorDataTypesExchange, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_py3.py new file mode 100644 index 000000000000..a0a81ab29652 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_py3.py @@ -0,0 +1,34 @@ +# 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 OfficeDataConnectorDataTypes(Model): + """The available data types for office data connector. + + :param share_point: SharePoint data type connection. + :type share_point: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint + :param exchange: Exchange data type connection. + :type exchange: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange + """ + + _attribute_map = { + 'share_point': {'key': 'sharePoint', 'type': 'OfficeDataConnectorDataTypesSharePoint'}, + 'exchange': {'key': 'exchange', 'type': 'OfficeDataConnectorDataTypesExchange'}, + } + + def __init__(self, *, share_point=None, exchange=None, **kwargs) -> None: + super(OfficeDataConnectorDataTypes, self).__init__(**kwargs) + self.share_point = share_point + self.exchange = exchange diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.py new file mode 100644 index 000000000000..55dfd4350ed5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon): + """SharePoint data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnectorDataTypesSharePoint, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_py3.py new file mode 100644 index 000000000000..5e12e920d2c5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_py3.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon): + """SharePoint data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(OfficeDataConnectorDataTypesSharePoint, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py new file mode 100644 index 000000000000..7302bf453ecf --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_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 .data_connector_py3 import DataConnector + + +class OfficeDataConnector(DataConnector): + """Represents office data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'OfficeDataConnectorDataTypes'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(OfficeDataConnector, self).__init__(etag=etag, **kwargs) + self.context_id = context_id + self.data_types = data_types + self.kind = 'Office365' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py index 1d640838c0da..71f4acc7853b 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -31,3 +31,18 @@ class TriggerOperator(str, Enum): less_than = "LessThan" equal = "Equal" not_equal = "NotEqual" + + +class DataConnectorKind(str, Enum): + + azure_active_directory = "AzureActiveDirectory" + azure_security_center = "AzureSecurityCenter" + microsoft_cloud_app_security = "MicrosoftCloudAppSecurity" + threat_intelligence = "ThreatIntelligence" + office365 = "Office365" + + +class DataTypeState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py new file mode 100644 index 000000000000..8a5d5362da47 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.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 .data_connector import DataConnector + + +class TIDataConnector(DataConnector): + """Represents threat intelligence data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'TIDataConnectorDataTypes'}, + } + + def __init__(self, **kwargs): + super(TIDataConnector, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) + self.data_types = kwargs.get('data_types', None) + self.kind = 'ThreatIntelligence' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py new file mode 100644 index 000000000000..8109ed18495b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py @@ -0,0 +1,29 @@ +# 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 TIDataConnectorDataTypes(Model): + """The available data types for TI data connector. + + :param indicators: Data type for indicators connection. + :type indicators: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators + """ + + _attribute_map = { + 'indicators': {'key': 'indicators', 'type': 'TIDataConnectorDataTypesIndicators'}, + } + + def __init__(self, **kwargs): + super(TIDataConnectorDataTypes, self).__init__(**kwargs) + self.indicators = kwargs.get('indicators', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.py new file mode 100644 index 000000000000..6208e7113219 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class TIDataConnectorDataTypesIndicators(DataConnectorDataTypeCommon): + """Data type for indicators connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TIDataConnectorDataTypesIndicators, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_py3.py new file mode 100644 index 000000000000..f53b3e0b2dfd --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_py3.py @@ -0,0 +1,28 @@ +# 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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class TIDataConnectorDataTypesIndicators(DataConnectorDataTypeCommon): + """Data type for indicators connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(TIDataConnectorDataTypesIndicators, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py new file mode 100644 index 000000000000..c96a8d6db3b4 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py @@ -0,0 +1,29 @@ +# 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 TIDataConnectorDataTypes(Model): + """The available data types for TI data connector. + + :param indicators: Data type for indicators connection. + :type indicators: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators + """ + + _attribute_map = { + 'indicators': {'key': 'indicators', 'type': 'TIDataConnectorDataTypesIndicators'}, + } + + def __init__(self, *, indicators=None, **kwargs) -> None: + super(TIDataConnectorDataTypes, self).__init__(**kwargs) + self.indicators = indicators diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py new file mode 100644 index 000000000000..3e2cb053bb05 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_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 .data_connector_py3 import DataConnector + + +class TIDataConnector(DataConnector): + """Represents threat intelligence data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'TIDataConnectorDataTypes'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(TIDataConnector, self).__init__(etag=etag, **kwargs) + self.context_id = context_id + self.data_types = data_types + self.kind = 'ThreatIntelligence' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py index fccf5dd12dbe..d2ed4a88c33a 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py @@ -11,8 +11,10 @@ from .operations import Operations from .alert_rules_operations import AlertRulesOperations +from .data_connectors_operations import DataConnectorsOperations __all__ = [ 'Operations', 'AlertRulesOperations', + 'DataConnectorsOperations', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py new file mode 100644 index 000000000000..408213b64719 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py @@ -0,0 +1,322 @@ +# 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 DataConnectorsOperations(object): + """DataConnectorsOperations 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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list( + self, resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all data connectors. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 DataConnector + :rtype: + ~azure.mgmt.securityinsight.models.DataConnectorPaged[~azure.mgmt.securityinsight.models.DataConnector] + :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}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.DataConnectorPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DataConnectorPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, custom_headers=None, raw=False, **operation_config): + """Gets a data connector. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param data_connector_id: Connector ID + :type data_connector_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: DataConnector or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.DataConnector 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}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'dataConnectorId': self._serialize.url("data_connector_id", data_connector_id, '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('DataConnector', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} + + def create( + self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, data_connector, custom_headers=None, raw=False, **operation_config): + """Creates or updates the data connector. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param data_connector_id: Connector ID + :type data_connector_id: str + :param data_connector: The data connector + :type data_connector: ~azure.mgmt.securityinsight.models.DataConnector + :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: DataConnector or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.DataConnector 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}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'dataConnectorId': self._serialize.url("data_connector_id", data_connector_id, '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(data_connector, 'DataConnector') + + # 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, 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('DataConnector', response) + if response.status_code == 201: + deserialized = self._deserialize('DataConnector', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} + + def delete( + self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, custom_headers=None, raw=False, **operation_config): + """Delete the data connector. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param data_connector_id: Connector ID + :type data_connector_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: 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}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'dataConnectorId': self._serialize.url("data_connector_id", data_connector_id, '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 [200, 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}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py index 76cf6b21f37f..b32b1e4ee1ee 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.operations import Operations from .operations.alert_rules_operations import AlertRulesOperations +from .operations.data_connectors_operations import DataConnectorsOperations from . import models @@ -60,6 +61,8 @@ class SecurityInsights(SDKClient): :vartype operations: azure.mgmt.securityinsight.operations.Operations :ivar alert_rules: AlertRules operations :vartype alert_rules: azure.mgmt.securityinsight.operations.AlertRulesOperations + :ivar data_connectors: DataConnectors operations + :vartype data_connectors: azure.mgmt.securityinsight.operations.DataConnectorsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -84,3 +87,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.alert_rules = AlertRulesOperations( self._client, self.config, self._serialize, self._deserialize) + self.data_connectors = DataConnectorsOperations( + self._client, self.config, self._serialize, self._deserialize)