diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/README.md b/sdk/securityinsight/azure-mgmt-securityinsight/README.md
index 4059c53bc934..9a3dd14aa602 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/README.md
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/README.md
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python
This is the Microsoft Azure Security Insight Management Client Library.
-This package has been tested with Python 3.7+.
+This package has been tested with Python 3.8+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
### Prerequisites
-- Python 3.7+ is required to use this package.
+- Python 3.8+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)
### Install the package
@@ -28,7 +28,7 @@ By default, [Azure Active Directory](https://aka.ms/awps/aad) token authenticati
- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
-- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+- `AZURE_CLIENT_SECRET` for Azure client secret.
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
@@ -45,8 +45,9 @@ client = SecurityInsights(credential=DefaultAzureCredential(), subscription_id=s
## Examples
-
-Code samples for this package can be found at [Security Insight Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
+Code samples for this package can be found at:
+- [Search Security Insight Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
+- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
## Troubleshooting
@@ -58,6 +59,3 @@ Code samples for this package can be found at [Security Insight Management](http
If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.
-
-
-
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/_meta.json b/sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
index fa7204443a7e..e7256e3a6a47 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "89a9bf17524904e7670f0fd2d62ac882ca00d85c",
+ "commit": "6463ab7ac58e1d7f3a23700629bf8c63225478c8",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
- "autorest": "3.9.2",
+ "autorest": "3.10.2",
"use": [
- "@autorest/python@6.2.7",
- "@autorest/modelerfour@4.24.3"
+ "@autorest/python@6.27.4",
+ "@autorest/modelerfour@4.27.0"
],
- "autorest_command": "autorest specification/securityinsights/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
+ "autorest_command": "autorest specification/securityinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/securityinsights/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py
index 68c8b7a5523e..0f0aea3d5053 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py
@@ -5,15 +5,21 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._security_insights import SecurityInsights
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._security_insights import SecurityInsights # type: ignore
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -21,6 +27,6 @@
__all__ = [
"SecurityInsights",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_configuration.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_configuration.py
index 9b68f6af78ea..d0cc8475ec46 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_configuration.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_configuration.py
@@ -6,26 +6,18 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-import sys
from typing import Any, TYPE_CHECKING
-from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
from ._version import VERSION
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
+class SecurityInsightsConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SecurityInsights.
Note that all parameters used to create this instance are saved as instance
@@ -33,16 +25,15 @@ class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
- :param subscription_id: The ID of the target subscription. Required.
+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding
- this default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this
+ default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
- super(SecurityInsightsConfiguration, self).__init__(**kwargs)
- api_version: Literal["2022-12-01-preview"] = kwargs.pop("api_version", "2022-12-01-preview")
+ api_version: str = kwargs.pop("api_version", "2025-03-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@@ -54,6 +45,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-securityinsight/{}".format(VERSION))
+ self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
@@ -62,9 +54,9 @@ def _configure(self, **kwargs: Any) -> None:
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
- self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
+ self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_patch.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_patch.py
index f99e77fef986..17dbc073e01b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_patch.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_patch.py
@@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------
+
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_security_insights.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_security_insights.py
index 3cde4c860447..9c3dcc300081 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_security_insights.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_security_insights.py
@@ -8,9 +8,12 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
+from typing_extensions import Self
+from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
+from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from . import models as _models
from ._configuration import SecurityInsightsConfiguration
@@ -20,30 +23,24 @@
AlertRuleTemplatesOperations,
AlertRulesOperations,
AutomationRulesOperations,
- BookmarkOperations,
- BookmarkRelationsOperations,
BookmarksOperations,
- DataConnectorsCheckRequirementsOperations,
+ ContentPackageOperations,
+ ContentPackagesOperations,
+ ContentTemplateOperations,
+ ContentTemplatesOperations,
+ DataConnectorDefinitionsOperations,
DataConnectorsOperations,
- DomainWhoisOperations,
- EntitiesGetTimelineOperations,
EntitiesOperations,
- EntitiesRelationsOperations,
- EntityQueriesOperations,
- EntityQueryTemplatesOperations,
- EntityRelationsOperations,
- FileImportsOperations,
- GetOperations,
- GetRecommendationsOperations,
- IPGeodataOperations,
IncidentCommentsOperations,
IncidentRelationsOperations,
IncidentTasksOperations,
IncidentsOperations,
MetadataOperations,
- OfficeConsentsOperations,
Operations,
- ProductSettingsOperations,
+ ProductPackageOperations,
+ ProductPackagesOperations,
+ ProductTemplateOperations,
+ ProductTemplatesOperations,
SecurityMLAnalyticsSettingsOperations,
SentinelOnboardingStatesOperations,
SourceControlOperations,
@@ -51,17 +48,15 @@
ThreatIntelligenceIndicatorMetricsOperations,
ThreatIntelligenceIndicatorOperations,
ThreatIntelligenceIndicatorsOperations,
- UpdateOperations,
WatchlistItemsOperations,
WatchlistsOperations,
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class SecurityInsights: # pylint: disable=too-many-instance-attributes
"""API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.
:ivar alert_rules: AlertRulesOperations operations
@@ -73,34 +68,33 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
azure.mgmt.securityinsight.operations.AlertRuleTemplatesOperations
:ivar automation_rules: AutomationRulesOperations operations
:vartype automation_rules: azure.mgmt.securityinsight.operations.AutomationRulesOperations
+ :ivar entities: EntitiesOperations operations
+ :vartype entities: azure.mgmt.securityinsight.operations.EntitiesOperations
:ivar incidents: IncidentsOperations operations
:vartype incidents: azure.mgmt.securityinsight.operations.IncidentsOperations
:ivar bookmarks: BookmarksOperations operations
:vartype bookmarks: azure.mgmt.securityinsight.operations.BookmarksOperations
- :ivar bookmark_relations: BookmarkRelationsOperations operations
- :vartype bookmark_relations: azure.mgmt.securityinsight.operations.BookmarkRelationsOperations
- :ivar bookmark: BookmarkOperations operations
- :vartype bookmark: azure.mgmt.securityinsight.operations.BookmarkOperations
- :ivar ip_geodata: IPGeodataOperations operations
- :vartype ip_geodata: azure.mgmt.securityinsight.operations.IPGeodataOperations
- :ivar domain_whois: DomainWhoisOperations operations
- :vartype domain_whois: azure.mgmt.securityinsight.operations.DomainWhoisOperations
- :ivar entities: EntitiesOperations operations
- :vartype entities: azure.mgmt.securityinsight.operations.EntitiesOperations
- :ivar entities_get_timeline: EntitiesGetTimelineOperations operations
- :vartype entities_get_timeline:
- azure.mgmt.securityinsight.operations.EntitiesGetTimelineOperations
- :ivar entities_relations: EntitiesRelationsOperations operations
- :vartype entities_relations: azure.mgmt.securityinsight.operations.EntitiesRelationsOperations
- :ivar entity_relations: EntityRelationsOperations operations
- :vartype entity_relations: azure.mgmt.securityinsight.operations.EntityRelationsOperations
- :ivar entity_queries: EntityQueriesOperations operations
- :vartype entity_queries: azure.mgmt.securityinsight.operations.EntityQueriesOperations
- :ivar entity_query_templates: EntityQueryTemplatesOperations operations
- :vartype entity_query_templates:
- azure.mgmt.securityinsight.operations.EntityQueryTemplatesOperations
- :ivar file_imports: FileImportsOperations operations
- :vartype file_imports: azure.mgmt.securityinsight.operations.FileImportsOperations
+ :ivar content_packages: ContentPackagesOperations operations
+ :vartype content_packages: azure.mgmt.securityinsight.operations.ContentPackagesOperations
+ :ivar content_package: ContentPackageOperations operations
+ :vartype content_package: azure.mgmt.securityinsight.operations.ContentPackageOperations
+ :ivar product_packages: ProductPackagesOperations operations
+ :vartype product_packages: azure.mgmt.securityinsight.operations.ProductPackagesOperations
+ :ivar product_package: ProductPackageOperations operations
+ :vartype product_package: azure.mgmt.securityinsight.operations.ProductPackageOperations
+ :ivar product_templates: ProductTemplatesOperations operations
+ :vartype product_templates: azure.mgmt.securityinsight.operations.ProductTemplatesOperations
+ :ivar product_template: ProductTemplateOperations operations
+ :vartype product_template: azure.mgmt.securityinsight.operations.ProductTemplateOperations
+ :ivar content_templates: ContentTemplatesOperations operations
+ :vartype content_templates: azure.mgmt.securityinsight.operations.ContentTemplatesOperations
+ :ivar content_template: ContentTemplateOperations operations
+ :vartype content_template: azure.mgmt.securityinsight.operations.ContentTemplateOperations
+ :ivar data_connector_definitions: DataConnectorDefinitionsOperations operations
+ :vartype data_connector_definitions:
+ azure.mgmt.securityinsight.operations.DataConnectorDefinitionsOperations
+ :ivar data_connectors: DataConnectorsOperations operations
+ :vartype data_connectors: azure.mgmt.securityinsight.operations.DataConnectorsOperations
:ivar incident_comments: IncidentCommentsOperations operations
:vartype incident_comments: azure.mgmt.securityinsight.operations.IncidentCommentsOperations
:ivar incident_relations: IncidentRelationsOperations operations
@@ -109,23 +103,14 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype incident_tasks: azure.mgmt.securityinsight.operations.IncidentTasksOperations
:ivar metadata: MetadataOperations operations
:vartype metadata: azure.mgmt.securityinsight.operations.MetadataOperations
- :ivar office_consents: OfficeConsentsOperations operations
- :vartype office_consents: azure.mgmt.securityinsight.operations.OfficeConsentsOperations
:ivar sentinel_onboarding_states: SentinelOnboardingStatesOperations operations
:vartype sentinel_onboarding_states:
azure.mgmt.securityinsight.operations.SentinelOnboardingStatesOperations
- :ivar get_recommendations: GetRecommendationsOperations operations
- :vartype get_recommendations:
- azure.mgmt.securityinsight.operations.GetRecommendationsOperations
- :ivar get: GetOperations operations
- :vartype get: azure.mgmt.securityinsight.operations.GetOperations
- :ivar update: UpdateOperations operations
- :vartype update: azure.mgmt.securityinsight.operations.UpdateOperations
+ :ivar operations: Operations operations
+ :vartype operations: azure.mgmt.securityinsight.operations.Operations
:ivar security_ml_analytics_settings: SecurityMLAnalyticsSettingsOperations operations
:vartype security_ml_analytics_settings:
azure.mgmt.securityinsight.operations.SecurityMLAnalyticsSettingsOperations
- :ivar product_settings: ProductSettingsOperations operations
- :vartype product_settings: azure.mgmt.securityinsight.operations.ProductSettingsOperations
:ivar source_control: SourceControlOperations operations
:vartype source_control: azure.mgmt.securityinsight.operations.SourceControlOperations
:ivar source_controls: SourceControlsOperations operations
@@ -144,21 +129,14 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype watchlists: azure.mgmt.securityinsight.operations.WatchlistsOperations
:ivar watchlist_items: WatchlistItemsOperations operations
:vartype watchlist_items: azure.mgmt.securityinsight.operations.WatchlistItemsOperations
- :ivar data_connectors: DataConnectorsOperations operations
- :vartype data_connectors: azure.mgmt.securityinsight.operations.DataConnectorsOperations
- :ivar data_connectors_check_requirements: DataConnectorsCheckRequirementsOperations operations
- :vartype data_connectors_check_requirements:
- azure.mgmt.securityinsight.operations.DataConnectorsCheckRequirementsOperations
- :ivar operations: Operations operations
- :vartype operations: azure.mgmt.securityinsight.operations.Operations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
- :param subscription_id: The ID of the target subscription. Required.
+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding
- this default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this
+ default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
@@ -172,7 +150,25 @@ def __init__(
**kwargs: Any
) -> None:
self._config = SecurityInsightsConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
- self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
+ _policies = kwargs.pop("policies", None)
+ if _policies is None:
+ _policies = [
+ policies.RequestIdPolicy(**kwargs),
+ self._config.headers_policy,
+ self._config.user_agent_policy,
+ self._config.proxy_policy,
+ policies.ContentDecodePolicy(**kwargs),
+ ARMAutoResourceProviderRegistrationPolicy(),
+ self._config.redirect_policy,
+ self._config.retry_policy,
+ self._config.authentication_policy,
+ self._config.custom_hook_policy,
+ self._config.logging_policy,
+ policies.DistributedTracingPolicy(**kwargs),
+ policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
+ self._config.http_logging_policy,
+ ]
+ self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
@@ -186,29 +182,33 @@ def __init__(
self.automation_rules = AutomationRulesOperations(
self._client, self._config, self._serialize, self._deserialize
)
+ self.entities = EntitiesOperations(self._client, self._config, self._serialize, self._deserialize)
self.incidents = IncidentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.bookmarks = BookmarksOperations(self._client, self._config, self._serialize, self._deserialize)
- self.bookmark_relations = BookmarkRelationsOperations(
+ self.content_packages = ContentPackagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.bookmark = BookmarkOperations(self._client, self._config, self._serialize, self._deserialize)
- self.ip_geodata = IPGeodataOperations(self._client, self._config, self._serialize, self._deserialize)
- self.domain_whois = DomainWhoisOperations(self._client, self._config, self._serialize, self._deserialize)
- self.entities = EntitiesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.entities_get_timeline = EntitiesGetTimelineOperations(
+ self.content_package = ContentPackageOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.product_packages = ProductPackagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entities_relations = EntitiesRelationsOperations(
+ self.product_package = ProductPackageOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.product_templates = ProductTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entity_relations = EntityRelationsOperations(
+ self.product_template = ProductTemplateOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entity_queries = EntityQueriesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.entity_query_templates = EntityQueryTemplatesOperations(
+ self.content_templates = ContentTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.file_imports = FileImportsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.content_template = ContentTemplateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.data_connector_definitions = DataConnectorDefinitionsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.data_connectors = DataConnectorsOperations(self._client, self._config, self._serialize, self._deserialize)
self.incident_comments = IncidentCommentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
@@ -217,21 +217,13 @@ def __init__(
)
self.incident_tasks = IncidentTasksOperations(self._client, self._config, self._serialize, self._deserialize)
self.metadata = MetadataOperations(self._client, self._config, self._serialize, self._deserialize)
- self.office_consents = OfficeConsentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.sentinel_onboarding_states = SentinelOnboardingStatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.get_recommendations = GetRecommendationsOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
- self.get = GetOperations(self._client, self._config, self._serialize, self._deserialize)
- self.update = UpdateOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.security_ml_analytics_settings = SecurityMLAnalyticsSettingsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.product_settings = ProductSettingsOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
self.source_control = SourceControlOperations(self._client, self._config, self._serialize, self._deserialize)
self.source_controls = SourceControlsOperations(self._client, self._config, self._serialize, self._deserialize)
self.threat_intelligence_indicator = ThreatIntelligenceIndicatorOperations(
@@ -245,13 +237,8 @@ def __init__(
)
self.watchlists = WatchlistsOperations(self._client, self._config, self._serialize, self._deserialize)
self.watchlist_items = WatchlistItemsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.data_connectors = DataConnectorsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.data_connectors_check_requirements = DataConnectorsCheckRequirementsOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
- self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
- def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
+ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@@ -271,14 +258,14 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
- return self._client.send_request(request_copy, **kwargs)
+ return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
def close(self) -> None:
self._client.close()
- def __enter__(self) -> "SecurityInsights":
+ def __enter__(self) -> Self:
self._client.__enter__()
return self
- def __exit__(self, *exc_details) -> None:
+ def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_serialization.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_serialization.py
index 2c170e28dbca..b24ab2885450 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_serialization.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_serialization.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -24,7 +25,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -38,7 +38,21 @@
import re
import sys
import codecs
-from typing import Optional, Union, AnyStr, IO, Mapping
+from typing import (
+ Dict,
+ Any,
+ cast,
+ Optional,
+ Union,
+ AnyStr,
+ IO,
+ Mapping,
+ Callable,
+ TypeVar,
+ MutableMapping,
+ Type,
+ List,
+)
try:
from urllib import quote # type: ignore
@@ -48,12 +62,14 @@
import isodate # type: ignore
-from typing import Dict, Any, cast
-
-from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback
+from azure.core.exceptions import DeserializationError, SerializationError
+from azure.core.serialization import NULL as CoreNull
_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")
+ModelType = TypeVar("ModelType", bound="Model")
+JSON = MutableMapping[str, Any]
+
class RawDeserializer:
@@ -74,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
:param data: Input, could be bytes or stream (will be decoded with UTF8) or text
:type data: str or bytes or IO
:param str content_type: The content type.
+ :return: The deserialized data.
+ :rtype: object
"""
if hasattr(data, "read"):
# Assume a stream
@@ -95,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
try:
return json.loads(data_as_str)
except ValueError as err:
- raise DeserializationError("JSON is invalid: {}".format(err), err)
+ raise DeserializationError("JSON is invalid: {}".format(err), err) from err
elif "xml" in (content_type or []):
try:
@@ -107,7 +125,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
pass
return ET.fromstring(data_as_str) # nosec
- except ET.ParseError:
+ except ET.ParseError as err:
# It might be because the server has an issue, and returned JSON with
# content-type XML....
# So let's try a JSON load, and if it's still broken
@@ -126,7 +144,9 @@ def _json_attemp(data):
# The function hack is because Py2.7 messes up with exception
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
- raise_with_traceback(DeserializationError, "XML is invalid")
+ raise DeserializationError("XML is invalid") from err
+ elif content_type.startswith("text/"):
+ return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
@classmethod
@@ -136,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -153,13 +178,6 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
return None
-try:
- basestring # type: ignore
- unicode_str = unicode # type: ignore
-except NameError:
- basestring = str
- unicode_str = str
-
_LOGGER = logging.getLogger(__name__)
try:
@@ -172,15 +190,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -194,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -223,24 +256,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
+ self.additional_properties: Optional[Dict[str, Any]] = {}
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -287,25 +329,35 @@ def __init__(self, **kwargs):
else:
setattr(self, k, kwargs[k])
- def __eq__(self, other):
- """Compare objects by comparing all attributes."""
+ def __eq__(self, other: Any) -> bool:
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are equal
+ :rtype: bool
+ """
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
return False
- def __ne__(self, other):
- """Compare objects by comparing all attributes."""
+ def __ne__(self, other: Any) -> bool:
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are not equal
+ :rtype: bool
+ """
return not self.__eq__(other)
- def __str__(self):
+ def __str__(self) -> str:
return str(self.__dict__)
@classmethod
- def enable_additional_properties_sending(cls):
+ def enable_additional_properties_sending(cls) -> None:
cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"}
@classmethod
- def is_xml_model(cls):
+ def is_xml_model(cls) -> bool:
try:
cls._xml_map # type: ignore
except AttributeError:
@@ -314,7 +366,11 @@ def is_xml_model(cls):
@classmethod
def _create_xml_node(cls):
- """Create XML node."""
+ """Create XML node.
+
+ :returns: The XML node
+ :rtype: xml.etree.ElementTree.Element
+ """
try:
xml_map = cls._xml_map # type: ignore
except AttributeError:
@@ -322,8 +378,8 @@ def _create_xml_node(cls):
return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None))
- def serialize(self, keep_readonly=False, **kwargs):
- """Return the JSON that would be sent to azure from this model.
+ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
+ """Return the JSON that would be sent to server from this model.
This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`.
@@ -334,10 +390,17 @@ def serialize(self, keep_readonly=False, **kwargs):
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs)
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, keep_readonly=keep_readonly, **kwargs
+ )
- def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs):
- """Return a dict that can be JSONify using json.dump.
+ def as_dict(
+ self,
+ keep_readonly: bool = True,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
+ **kwargs: Any
+ ) -> JSON:
+ """Return a dict that can be serialized using json.dump.
Advanced usage might optionally use a callback as parameter:
@@ -363,12 +426,15 @@ def my_key_transformer(key, attr_desc, value):
If you want XML serialization, you can pass the kwargs is_xml=True.
+ :param bool keep_readonly: If you want to serialize the readonly attributes
:param function key_transformer: A key transformer function.
:returns: A dict JSON compatible object
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs)
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs
+ )
@classmethod
def _infer_class_models(cls):
@@ -378,25 +444,31 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@classmethod
- def deserialize(cls, data, content_type=None):
+ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
"""Parse a str using the RestAPI syntax and return a model.
:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
- return deserializer(cls.__name__, data, content_type=content_type)
+ return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@classmethod
- def from_dict(cls, data, key_extractors=None, content_type=None):
+ def from_dict(
+ cls: Type[ModelType],
+ data: Any,
+ key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
+ content_type: Optional[str] = None,
+ ) -> ModelType:
"""Parse a dict using given key extractor return a model.
By default consider key
@@ -404,13 +476,15 @@ def from_dict(cls, data, key_extractors=None, content_type=None):
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
- deserializer.key_extractors = (
- [
+ deserializer.key_extractors = ( # type: ignore
+ [ # type: ignore
attribute_key_case_insensitive_extractor,
rest_key_case_insensitive_extractor,
last_rest_key_case_insensitive_extractor,
@@ -418,7 +492,7 @@ def from_dict(cls, data, key_extractors=None, content_type=None):
if key_extractors is None
else key_extractors
)
- return deserializer(cls.__name__, data, content_type=content_type)
+ return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@classmethod
def _flatten_subtype(cls, key, objects):
@@ -426,21 +500,25 @@ def _flatten_subtype(cls, key, objects):
return {}
result = dict(cls._subtype_map[key])
for valuetype in cls._subtype_map[key].values():
- result.update(objects[valuetype]._flatten_subtype(key, objects))
+ result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
return result
@classmethod
def _classify(cls, response, objects):
"""Check the class _subtype_map for any child classes.
We want to ignore any inherited _subtype_maps.
- Remove the polymorphic key from the initial data.
+
+ :param dict response: The initial data
+ :param dict objects: The class objects
+ :returns: The class to be used
+ :rtype: class
"""
for subtype_key in cls.__dict__.get("_subtype_map", {}).keys():
subtype_value = None
if not isinstance(response, ET.Element):
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
- subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
+ subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
else:
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
if subtype_value:
@@ -479,11 +557,13 @@ def _decode_attribute_map_key(key):
inside the received data.
:param str key: A key string from the generated code
+ :returns: The decoded key
+ :rtype: str
"""
return key.replace("\\.", ".")
-class Serializer(object):
+class Serializer: # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -518,7 +598,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
- def __init__(self, classes=None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@@ -534,17 +614,20 @@ def __init__(self, classes=None):
"[]": self.serialize_iter,
"{}": self.serialize_dict,
}
- self.dependencies = dict(classes) if classes else {}
+ self.dependencies: Dict[str, type] = dict(classes) if classes else {}
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -570,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
serialized = {}
if is_xml_model_serialization:
- serialized = target_obj._create_xml_node()
+ serialized = target_obj._create_xml_node() # pylint: disable=protected-access
try:
- attributes = target_obj._attribute_map
+ attributes = target_obj._attribute_map # pylint: disable=protected-access
for attr, attr_desc in attributes.items():
attr_name = attr
- if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False):
+ if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access
+ attr_name, {}
+ ).get("readonly", False):
continue
if attr_name == "additional_properties" and attr_desc["key"] == "":
@@ -602,7 +687,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if xml_desc.get("attr", False):
if xml_ns:
ET.register_namespace(xml_prefix, xml_ns)
- xml_name = "{}{}".format(xml_ns, xml_name)
+ xml_name = "{{{}}}{}".format(xml_ns, xml_name)
serialized.set(xml_name, new_attr) # type: ignore
continue
if xml_desc.get("text", False):
@@ -611,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if isinstance(new_attr, list):
serialized.extend(new_attr) # type: ignore
elif isinstance(new_attr, ET.Element):
- # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces.
+ # If the down XML has no XML/Name,
+ # we MUST replace the tag with the local tag. But keeping the namespaces.
if "name" not in getattr(orig_attr, "_xml_map", {}):
splitted_tag = new_attr.tag.split("}")
if len(splitted_tag) == 2: # Namespace
@@ -622,12 +708,11 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
else: # That's a basic type
# Integrate namespace if necessary
local_node = _create_xml_node(xml_name, xml_prefix, xml_ns)
- local_node.text = unicode_str(new_attr)
+ local_node.text = str(new_attr)
serialized.append(local_node) # type: ignore
else: # JSON
for k in reversed(keys): # type: ignore
- unflattened = {k: new_attr}
- new_attr = unflattened
+ new_attr = {k: new_attr}
_new_attr = new_attr
_serialized = serialized
@@ -636,28 +721,29 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
_serialized.update(_new_attr) # type: ignore
_new_attr = _new_attr[k] # type: ignore
_serialized = _serialized[k]
- except ValueError:
- continue
+ except ValueError as err:
+ if isinstance(err, SerializationError):
+ raise
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
- raise_with_traceback(SerializationError, msg, err)
- else:
- return serialized
+ raise SerializationError(msg) from err
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
- internal_data_type = data_type.strip("[]{}")
- internal_data_type = self.dependencies.get(internal_data_type, None)
+ internal_data_type_str = data_type.strip("[]{}")
+ internal_data_type = self.dependencies.get(internal_data_type_str, None)
try:
is_xml_model_serialization = kwargs["is_xml"]
except KeyError:
@@ -681,18 +767,20 @@ def body(self, data, data_type, **kwargs):
attribute_key_case_insensitive_extractor,
last_rest_key_case_insensitive_extractor,
]
- data = deserializer._deserialize(data_type, data)
+ data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access
except DeserializationError as err:
- raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err)
+ raise SerializationError("Unable to build a model: " + str(err)) from err
return self._serialize(data, data_type, **kwargs)
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -703,30 +791,30 @@ def url(self, name, data, data_type, **kwargs):
if kwargs.get("skip_quote") is True:
output = str(output)
+ output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :rtype: str
+ :rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
- if not kwargs.get("skip_quote", False):
- data = [quote(str(d), safe="") for d in data]
- return str(self.serialize_iter(data, internal_data_type, **kwargs))
+ do_quote = not kwargs.get("skip_quote", False)
+ return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
output = self.serialize_data(data, data_type, **kwargs)
@@ -736,19 +824,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -757,30 +846,31 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
try:
+ if data is CoreNull:
+ return None
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
- elif data_type in self.serialize_type:
+ if data_type in self.serialize_type:
return self.serialize_type[data_type](data, **kwargs)
# If dependencies is empty, try with current data class
@@ -795,12 +885,11 @@ def serialize_data(self, data, data_type, **kwargs):
except (ValueError, TypeError) as err:
msg = "Unable to serialize value: {!r} as type: {!r}."
- raise_with_traceback(SerializationError, msg.format(data, data_type), err)
- else:
- return self._serialize(data, **kwargs)
+ raise SerializationError(msg.format(data, data_type)) from err
+ return self._serialize(data, **kwargs)
@classmethod
- def _get_custom_serializers(cls, data_type, **kwargs):
+ def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements
custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type)
if custom_serializer:
return custom_serializer
@@ -816,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs):
- basic_types_serializers dict[str, callable] : If set, use the callable as serializer
- is_xml bool : If set, use xml_basic_types_serializers
- :param data: Object to be serialized.
+ :param obj data: Object to be serialized.
:param str data_type: Type of object in the iterable.
+ :rtype: str, int, float, bool
+ :return: serialized object
"""
custom_serializer = cls._get_custom_serializers(data_type, **kwargs)
if custom_serializer:
return custom_serializer(data)
if data_type == "str":
return cls.serialize_unicode(data)
- return eval(data_type)(data) # nosec
+ return eval(data_type)(data) # nosec # pylint: disable=eval-used
@classmethod
def serialize_unicode(cls, data):
"""Special handling for serializing unicode strings in Py2.
Encode to UTF-8 if unicode, otherwise handle as a str.
- :param data: Object to be serialized.
+ :param str data: Object to be serialized.
:rtype: str
+ :return: serialized object
"""
try: # If I received an enum, return its value
return data.value
@@ -846,8 +938,7 @@ def serialize_unicode(cls, data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
def serialize_iter(self, data, iter_type, div=None, **kwargs):
"""Serialize iterable.
@@ -857,13 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
serialization_ctxt['type'] should be same as data_type.
- is_xml bool : If set, serialize as XML
- :param list attr: Object to be serialized.
+ :param list data: Object to be serialized.
:param str iter_type: Type of object in the iterable.
- :param bool required: Whether the objects in the iterable must
- not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
+ Defaults to False.
:rtype: list, str
+ :return: serialized iterable
"""
if isinstance(data, str):
raise SerializationError("Refuse str type as a valid iter type.")
@@ -875,9 +966,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
for d in data:
try:
serialized.append(self.serialize_data(d, iter_type, **kwargs))
- except ValueError:
+ except ValueError as err:
+ if isinstance(err, SerializationError):
+ raise
serialized.append(None)
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
+
if div:
serialized = ["" if s is None else str(s) for s in serialized]
serialized = div.join(serialized)
@@ -913,16 +1009,17 @@ def serialize_dict(self, attr, dict_type, **kwargs):
:param dict attr: Object to be serialized.
:param str dict_type: Type of object in the dictionary.
- :param bool required: Whether the objects in the dictionary must
- not be None or empty.
:rtype: dict
+ :return: serialized dictionary
"""
serialization_ctxt = kwargs.get("serialization_ctxt", {})
serialized = {}
for key, value in attr.items():
try:
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
- except ValueError:
+ except ValueError as err:
+ if isinstance(err, SerializationError):
+ raise
serialized[self.serialize_unicode(key)] = None
if "xml" in serialization_ctxt:
@@ -937,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs):
return serialized
- def serialize_object(self, attr, **kwargs):
+ def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Serialize a generic object.
This will be handled as a dictionary. If object passed in is not
a basic type (str, int, float, dict, list) it will simply be
@@ -945,6 +1042,7 @@ def serialize_object(self, attr, **kwargs):
:param dict attr: Object to be serialized.
:rtype: dict or str
+ :return: serialized object
"""
if attr is None:
return None
@@ -955,7 +1053,7 @@ def serialize_object(self, attr, **kwargs):
return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs)
if obj_type is _long_type:
return self.serialize_long(attr)
- if obj_type is unicode_str:
+ if obj_type is str:
return self.serialize_unicode(attr)
if obj_type is datetime.datetime:
return self.serialize_iso(attr)
@@ -969,7 +1067,7 @@ def serialize_object(self, attr, **kwargs):
return self.serialize_decimal(attr)
# If it's a model or I know this dependency, serialize as a Model
- elif obj_type in self.dependencies.values() or isinstance(attr, Model):
+ if obj_type in self.dependencies.values() or isinstance(attr, Model):
return self._serialize(attr)
if obj_type == dict:
@@ -1000,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None):
try:
enum_obj(result) # type: ignore
return result
- except ValueError:
+ except ValueError as exc:
for enum_value in enum_obj: # type: ignore
if enum_value.value.lower() == str(attr).lower():
return enum_value.value
error = "{!r} is not valid value for enum {!r}"
- raise SerializationError(error.format(attr, enum_obj))
+ raise SerializationError(error.format(attr, enum_obj)) from exc
@staticmethod
- def serialize_bytearray(attr, **kwargs):
+ def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize bytearray into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
return b64encode(attr).decode()
@staticmethod
- def serialize_base64(attr, **kwargs):
+ def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize str into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
encoded = b64encode(attr).decode("ascii")
return encoded.strip("=").replace("+", "-").replace("/", "_")
@staticmethod
- def serialize_decimal(attr, **kwargs):
+ def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Decimal object to float.
- :param attr: Object to be serialized.
+ :param decimal attr: Object to be serialized.
:rtype: float
+ :return: serialized decimal
"""
return float(attr)
@staticmethod
- def serialize_long(attr, **kwargs):
+ def serialize_long(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize long (Py2) or int (Py3).
- :param attr: Object to be serialized.
+ :param int attr: Object to be serialized.
:rtype: int/long
+ :return: serialized long
"""
return _long_type(attr)
@staticmethod
- def serialize_date(attr, **kwargs):
+ def serialize_date(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Date object into ISO-8601 formatted string.
:param Date attr: Object to be serialized.
:rtype: str
+ :return: serialized date
"""
if isinstance(attr, str):
attr = isodate.parse_date(attr)
@@ -1057,11 +1160,12 @@ def serialize_date(attr, **kwargs):
return t
@staticmethod
- def serialize_time(attr, **kwargs):
+ def serialize_time(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Time object into ISO-8601 formatted string.
:param datetime.time attr: Object to be serialized.
:rtype: str
+ :return: serialized time
"""
if isinstance(attr, str):
attr = isodate.parse_time(attr)
@@ -1071,30 +1175,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1107,12 +1213,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1132,19 +1239,20 @@ def serialize_iso(attr, **kwargs):
return date + microseconds + "Z"
except (ValueError, OverflowError) as err:
msg = "Unable to serialize datetime object."
- raise_with_traceback(SerializationError, msg, err)
+ raise SerializationError(msg) from err
except AttributeError as err:
msg = "ISO-8601 object must be valid Datetime object."
- raise_with_traceback(TypeError, msg, err)
+ raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1152,16 +1260,17 @@ def serialize_unix(attr, **kwargs):
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
return int(calendar.timegm(attr.utctimetuple()))
- except AttributeError:
- raise TypeError("Unix time object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("Unix time object must be valid Datetime object.") from exc
-def rest_key_extractor(attr, attr_desc, data):
+def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
key = attr_desc["key"]
working_data = data
while "." in key:
- dict_keys = _FLATTEN.split(key)
+ # Need the cast, as for some reasons "split" is typed as list[str | Any]
+ dict_keys = cast(List[str], _FLATTEN.split(key))
if len(dict_keys) == 1:
key = _decode_attribute_map_key(dict_keys[0])
break
@@ -1170,14 +1279,15 @@ def rest_key_extractor(attr, attr_desc, data):
if working_data is None:
# If at any point while following flatten JSON path see None, it means
# that all properties under are None as well
- # https://github.com/Azure/msrest-for-python/issues/197
return None
key = ".".join(dict_keys[1:])
return working_data.get(key)
-def rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements
+ attr, attr_desc, data
+):
key = attr_desc["key"]
working_data = data
@@ -1191,7 +1301,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
if working_data is None:
# If at any point while following flatten JSON path see None, it means
# that all properties under are None as well
- # https://github.com/Azure/msrest-for-python/issues/197
return None
key = ".".join(dict_keys[1:])
@@ -1199,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
return attribute_key_case_insensitive_extractor(key, None, working_data)
-def last_rest_key_extractor(attr, attr_desc, data):
- """Extract the attribute in "data" based on the last part of the JSON path key."""
+def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
+ """Extract the attribute in "data" based on the last part of the JSON path key.
+
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
+ """
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
return attribute_key_extractor(dict_keys[-1], None, data)
-def last_rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
"""Extract the attribute in "data" based on the last part of the JSON path key.
This is the case insensitive version of "last_rest_key_extractor"
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
"""
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
@@ -1242,11 +1363,11 @@ def _extract_name_from_internal_type(internal_type):
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
xml_ns = internal_type_xml_map.get("ns", None)
if xml_ns:
- xml_name = "{}{}".format(xml_ns, xml_name)
+ xml_name = "{{{}}}{}".format(xml_ns, xml_name)
return xml_name
-def xml_key_extractor(attr, attr_desc, data):
+def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements
if isinstance(data, dict):
return None
@@ -1266,7 +1387,7 @@ def xml_key_extractor(attr, attr_desc, data):
# Integrate namespace if necessary
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
if xml_ns:
- xml_name = "{}{}".format(xml_ns, xml_name)
+ xml_name = "{{{}}}{}".format(xml_ns, xml_name)
# If it's an attribute, that's simple
if xml_desc.get("attr", False):
@@ -1298,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1321,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data):
return children[0]
-class Deserializer(object):
+class Deserializer:
"""Response object model deserializer.
:param dict classes: Class type dictionary for deserializing complex types.
@@ -1330,9 +1450,9 @@ class Deserializer(object):
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
- valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
+ valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
- def __init__(self, classes=None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@@ -1352,7 +1472,7 @@ def __init__(self, classes=None):
"duration": (isodate.Duration, datetime.timedelta),
"iso-8601": (datetime.datetime),
}
- self.dependencies = dict(classes) if classes else {}
+ self.dependencies: Dict[str, type] = dict(classes) if classes else {}
self.key_extractors = [rest_key_extractor, xml_key_extractor]
# Additional properties only works if the "rest_key_extractor" is used to
# extract the keys. Making it to work whatever the key extractor is too much
@@ -1370,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1383,12 +1504,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1405,15 +1527,15 @@ def _deserialize(self, target_obj, data):
response, class_name = self._classify_target(target_obj, data)
- if isinstance(response, basestring):
+ if isinstance(response, str):
return self.deserialize_data(data, response)
- elif isinstance(response, type) and issubclass(response, Enum):
+ if isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)
- if data is None:
+ if data is None or data is CoreNull:
return data
try:
- attributes = response._attribute_map # type: ignore
+ attributes = response._attribute_map # type: ignore # pylint: disable=protected-access
d_attrs = {}
for attr, attr_desc in attributes.items():
# Check empty string. If it's not empty, someone has a real "additionalProperties"...
@@ -1442,10 +1564,9 @@ def _deserialize(self, target_obj, data):
d_attrs[attr] = value
except (AttributeError, TypeError, KeyError) as err:
msg = "Unable to deserialize to object: " + class_name # type: ignore
- raise_with_traceback(DeserializationError, msg, err)
- else:
- additional_properties = self._build_additional_properties(attributes, data)
- return self._instantiate_model(response, d_attrs, additional_properties)
+ raise DeserializationError(msg) from err
+ additional_properties = self._build_additional_properties(attributes, data)
+ return self._instantiate_model(response, d_attrs, additional_properties)
def _build_additional_properties(self, attribute_map, data):
if not self.additional_properties_detection:
@@ -1471,22 +1592,24 @@ def _classify_target(self, target, data):
Once classification has been determined, initialize object.
:param str target: The target object type to deserialize to.
- :param str/dict data: The response data to deseralize.
+ :param str/dict data: The response data to deserialize.
+ :return: The classified target object and its class name.
+ :rtype: tuple
"""
if target is None:
return None, None
- if isinstance(target, basestring):
+ if isinstance(target, str):
try:
target = self.dependencies[target]
except KeyError:
return target, target
try:
- target = target._classify(data, self.dependencies)
+ target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access
except AttributeError:
pass # Target is not a Model, no classify
- return target, target.__class__.__name__
+ return target, target.__class__.__name__ # type: ignore
def failsafe_deserialize(self, target_obj, data, content_type=None):
"""Ignores any errors encountered in deserialization,
@@ -1496,12 +1619,14 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
a deserialization error.
:param str target_obj: The target object type to deserialize to.
- :param str/dict data: The response data to deseralize.
+ :param str/dict data: The response data to deserialize.
:param str content_type: Swagger "produces" if available.
+ :return: Deserialized object.
+ :rtype: object
"""
try:
return self(target_obj, data, content_type=content_type)
- except:
+ except: # pylint: disable=bare-except
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
@@ -1519,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None):
If raw_data is something else, bypass all logic and return it directly.
- :param raw_data: Data to be processed.
- :param content_type: How to parse if raw_data is a string/bytes.
+ :param obj raw_data: Data to be processed.
+ :param str content_type: How to parse if raw_data is a string/bytes.
:raises JSONDecodeError: If JSON is requested and parsing is impossible.
:raises UnicodeDecodeError: If bytes is not UTF8
+ :rtype: object
+ :return: Unpacked content.
"""
# Assume this is enough to detect a Pipeline Response without importing it
context = getattr(raw_data, "context", {})
@@ -1539,31 +1666,42 @@ def _unpack_content(raw_data, content_type=None):
if hasattr(raw_data, "_content_consumed"):
return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers)
- if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"):
+ if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"):
return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore
return raw_data
def _instantiate_model(self, response, attrs, additional_properties=None):
"""Instantiate a response model passing in deserialized args.
- :param response: The response model class.
- :param d_attrs: The deserialized response attributes.
+ :param Response response: The response model class.
+ :param dict attrs: The deserialized response attributes.
+ :param dict additional_properties: Additional properties to be set.
+ :rtype: Response
+ :return: The instantiated response model.
"""
if callable(response):
subtype = getattr(response, "_subtype_map", {})
try:
- readonly = [k for k, v in response._validation.items() if v.get("readonly")]
- const = [k for k, v in response._validation.items() if v.get("constant")]
+ readonly = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("readonly")
+ ]
+ const = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("constant")
+ ]
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
response_obj = response(**kwargs)
for attr in readonly:
setattr(response_obj, attr, attrs.get(attr))
if additional_properties:
- response_obj.additional_properties = additional_properties
+ response_obj.additional_properties = additional_properties # type: ignore
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
- raise DeserializationError(msg + str(err))
+ raise DeserializationError(msg + str(err)) from err
else:
try:
for attr, value in attrs.items():
@@ -1572,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1594,7 +1733,11 @@ def deserialize_data(self, data, data_type):
if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())):
return data
- is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"]
+ is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment
+ "object",
+ "[]",
+ r"{}",
+ ]
if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text:
return None
data_val = self.deserialize_type[data_type](data)
@@ -1613,15 +1756,15 @@ def deserialize_data(self, data, data_type):
except (ValueError, TypeError, AttributeError) as err:
msg = "Unable to deserialize response data."
msg += " Data: {}, {}".format(data, data_type)
- raise_with_traceback(DeserializationError, msg, err)
- else:
- return self._deserialize(obj_type, data)
+ raise DeserializationError(msg) from err
+ return self._deserialize(obj_type, data)
def deserialize_iter(self, attr, iter_type):
"""Deserialize an iterable.
:param list attr: Iterable to be deserialized.
:param str iter_type: The type of object in the iterable.
+ :return: Deserialized iterable.
:rtype: list
"""
if attr is None:
@@ -1638,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type):
:param dict/list attr: Dictionary to be deserialized. Also accepts
a list of key, value pairs.
:param str dict_type: The object type of the items in the dictionary.
+ :return: Deserialized dictionary.
:rtype: dict
"""
if isinstance(attr, list):
@@ -1648,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1661,7 +1806,7 @@ def deserialize_object(self, attr, **kwargs):
if isinstance(attr, ET.Element):
# Do no recurse on XML, just return the tree as-is
return attr
- if isinstance(attr, basestring):
+ if isinstance(attr, str):
return self.deserialize_basic(attr, "str")
obj_type = type(attr)
if obj_type in self.basic_types:
@@ -1687,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs):
pass
return deserialized
- else:
- error = "Cannot deserialize generic object with type: "
- raise TypeError(error + str(obj_type))
+ error = "Cannot deserialize generic object with type: "
+ raise TypeError(error + str(obj_type))
- def deserialize_basic(self, attr, data_type):
+ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements
"""Deserialize basic builtin data type from string.
Will attempt to convert to str, int, float and bool.
This function will also accept '1', '0', 'true' and 'false' as
@@ -1699,6 +1843,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1710,24 +1855,23 @@ def deserialize_basic(self, attr, data_type):
if data_type == "str":
# None or '', node is empty string.
return ""
- else:
- # None or '', node with a strong type is None.
- # Don't try to model "empty bool" or "empty int"
- return None
+ # None or '', node with a strong type is None.
+ # Don't try to model "empty bool" or "empty int"
+ return None
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
- elif isinstance(attr, basestring):
+ if isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
- elif attr.lower() in ["false", "0"]:
+ if attr.lower() in ["false", "0"]:
return False
raise TypeError("Invalid boolean value: {}".format(attr))
if data_type == "str":
return self.deserialize_unicode(attr)
- return eval(data_type)(attr) # nosec
+ return eval(data_type)(attr) # nosec # pylint: disable=eval-used
@staticmethod
def deserialize_unicode(data):
@@ -1735,6 +1879,7 @@ def deserialize_unicode(data):
as a string.
:param str data: response string to be deserialized.
+ :return: Deserialized string.
:rtype: str or unicode
"""
# We might be here because we have an enum modeled as string,
@@ -1748,8 +1893,7 @@ def deserialize_unicode(data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
@staticmethod
def deserialize_enum(data, enum_obj):
@@ -1761,6 +1905,7 @@ def deserialize_enum(data, enum_obj):
:param str data: Response string to be deserialized. If this value is
None or invalid it will be returned as-is.
:param Enum enum_obj: Enum object to deserialize to.
+ :return: Deserialized enum object.
:rtype: Enum
"""
if isinstance(data, enum_obj) or data is None:
@@ -1769,12 +1914,11 @@ def deserialize_enum(data, enum_obj):
data = data.value
if isinstance(data, int):
# Workaround. We might consider remove it in the future.
- # https://github.com/Azure/azure-rest-api-specs/issues/141
try:
return list(enum_obj.__members__.values())[data]
- except IndexError:
+ except IndexError as exc:
error = "{!r} is not a valid index for enum {!r}"
- raise DeserializationError(error.format(data, enum_obj))
+ raise DeserializationError(error.format(data, enum_obj)) from exc
try:
return enum_obj(str(data))
except ValueError:
@@ -1790,6 +1934,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1802,6 +1947,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1817,22 +1963,24 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
try:
- return decimal.Decimal(attr) # type: ignore
+ return decimal.Decimal(str(attr)) # type: ignore
except decimal.DecimalException as err:
msg = "Invalid decimal {}".format(attr)
- raise_with_traceback(DeserializationError, msg, err)
+ raise DeserializationError(msg) from err
@staticmethod
def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1845,6 +1993,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1854,15 +2003,15 @@ def deserialize_duration(attr):
duration = isodate.parse_duration(attr)
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
- raise_with_traceback(DeserializationError, msg, err)
- else:
- return duration
+ raise DeserializationError(msg) from err
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1871,13 +2020,14 @@ def deserialize_date(attr):
if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore
raise DeserializationError("Date must have only digits and -. Received: %s" % attr)
# This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception.
- return isodate.parse_date(attr, defaultmonth=None, defaultday=None)
+ return isodate.parse_date(attr, defaultmonth=0, defaultday=0)
@staticmethod
def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1892,6 +2042,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1906,15 +2057,15 @@ def deserialize_rfc(attr):
date_obj = date_obj.astimezone(tz=TZ_UTC)
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
- raise_with_traceback(DeserializationError, msg, err)
- else:
- return date_obj
+ raise DeserializationError(msg) from err
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1943,9 +2094,8 @@ def deserialize_iso(attr):
raise OverflowError("Hit max or min date")
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize datetime object."
- raise_with_traceback(DeserializationError, msg, err)
- else:
- return date_obj
+ raise DeserializationError(msg) from err
+ return date_obj
@staticmethod
def deserialize_unix(attr):
@@ -1953,15 +2103,16 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
if isinstance(attr, ET.Element):
attr = int(attr.text) # type: ignore
try:
+ attr = int(attr)
date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC)
except ValueError as err:
msg = "Cannot deserialize to unix datetime object."
- raise_with_traceback(DeserializationError, msg, err)
- else:
- return date_obj
+ raise DeserializationError(msg) from err
+ return date_obj
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_vendor.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_vendor.py
deleted file mode 100644
index 9aad73fc743e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_vendor.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# --------------------------------------------------------------------------
-# 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 azure.core.pipeline.transport import HttpRequest
-
-
-def _convert_request(request, files=None):
- data = request.content if not files else None
- request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
- if files:
- request.set_formdata_body(files)
- return request
-
-
-def _format_url_section(template, **kwargs):
- components = template.split("/")
- while components:
- try:
- return template.format(**kwargs)
- except KeyError as key:
- formatted_components = template.split("/")
- components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
- template = "/".join(components)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_version.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_version.py
index 2eda20789583..e5754a47ce68 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_version.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "2.0.0b2"
+VERSION = "1.0.0b1"
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/__init__.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/__init__.py
index f9bb87768c2a..f2ffe2a2dc1d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/__init__.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/__init__.py
@@ -5,12 +5,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._security_insights import SecurityInsights
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._security_insights import SecurityInsights # type: ignore
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@
__all__ = [
"SecurityInsights",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_configuration.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_configuration.py
index e334994b3258..ba015206cb1e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_configuration.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_configuration.py
@@ -6,26 +6,18 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-import sys
from typing import Any, TYPE_CHECKING
-from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
+class SecurityInsightsConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SecurityInsights.
Note that all parameters used to create this instance are saved as instance
@@ -33,16 +25,15 @@ class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
- :param subscription_id: The ID of the target subscription. Required.
+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding
- this default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this
+ default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
- super(SecurityInsightsConfiguration, self).__init__(**kwargs)
- api_version: Literal["2022-12-01-preview"] = kwargs.pop("api_version", "2022-12-01-preview")
+ api_version: str = kwargs.pop("api_version", "2025-03-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@@ -54,6 +45,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-securityinsight/{}".format(VERSION))
+ self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)
def _configure(self, **kwargs: Any) -> None:
@@ -62,9 +54,9 @@ def _configure(self, **kwargs: Any) -> None:
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
- self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
+ self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_patch.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_patch.py
index f99e77fef986..17dbc073e01b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_patch.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_patch.py
@@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------
+
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_security_insights.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_security_insights.py
index 6a0f5faa2f24..6181ab136039 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_security_insights.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_security_insights.py
@@ -8,9 +8,12 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
+from typing_extensions import Self
+from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
+from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from .. import models as _models
from .._serialization import Deserializer, Serializer
@@ -20,30 +23,24 @@
AlertRuleTemplatesOperations,
AlertRulesOperations,
AutomationRulesOperations,
- BookmarkOperations,
- BookmarkRelationsOperations,
BookmarksOperations,
- DataConnectorsCheckRequirementsOperations,
+ ContentPackageOperations,
+ ContentPackagesOperations,
+ ContentTemplateOperations,
+ ContentTemplatesOperations,
+ DataConnectorDefinitionsOperations,
DataConnectorsOperations,
- DomainWhoisOperations,
- EntitiesGetTimelineOperations,
EntitiesOperations,
- EntitiesRelationsOperations,
- EntityQueriesOperations,
- EntityQueryTemplatesOperations,
- EntityRelationsOperations,
- FileImportsOperations,
- GetOperations,
- GetRecommendationsOperations,
- IPGeodataOperations,
IncidentCommentsOperations,
IncidentRelationsOperations,
IncidentTasksOperations,
IncidentsOperations,
MetadataOperations,
- OfficeConsentsOperations,
Operations,
- ProductSettingsOperations,
+ ProductPackageOperations,
+ ProductPackagesOperations,
+ ProductTemplateOperations,
+ ProductTemplatesOperations,
SecurityMLAnalyticsSettingsOperations,
SentinelOnboardingStatesOperations,
SourceControlOperations,
@@ -51,17 +48,15 @@
ThreatIntelligenceIndicatorMetricsOperations,
ThreatIntelligenceIndicatorOperations,
ThreatIntelligenceIndicatorsOperations,
- UpdateOperations,
WatchlistItemsOperations,
WatchlistsOperations,
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class SecurityInsights: # pylint: disable=too-many-instance-attributes
"""API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.
:ivar alert_rules: AlertRulesOperations operations
@@ -73,36 +68,35 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
azure.mgmt.securityinsight.aio.operations.AlertRuleTemplatesOperations
:ivar automation_rules: AutomationRulesOperations operations
:vartype automation_rules: azure.mgmt.securityinsight.aio.operations.AutomationRulesOperations
+ :ivar entities: EntitiesOperations operations
+ :vartype entities: azure.mgmt.securityinsight.aio.operations.EntitiesOperations
:ivar incidents: IncidentsOperations operations
:vartype incidents: azure.mgmt.securityinsight.aio.operations.IncidentsOperations
:ivar bookmarks: BookmarksOperations operations
:vartype bookmarks: azure.mgmt.securityinsight.aio.operations.BookmarksOperations
- :ivar bookmark_relations: BookmarkRelationsOperations operations
- :vartype bookmark_relations:
- azure.mgmt.securityinsight.aio.operations.BookmarkRelationsOperations
- :ivar bookmark: BookmarkOperations operations
- :vartype bookmark: azure.mgmt.securityinsight.aio.operations.BookmarkOperations
- :ivar ip_geodata: IPGeodataOperations operations
- :vartype ip_geodata: azure.mgmt.securityinsight.aio.operations.IPGeodataOperations
- :ivar domain_whois: DomainWhoisOperations operations
- :vartype domain_whois: azure.mgmt.securityinsight.aio.operations.DomainWhoisOperations
- :ivar entities: EntitiesOperations operations
- :vartype entities: azure.mgmt.securityinsight.aio.operations.EntitiesOperations
- :ivar entities_get_timeline: EntitiesGetTimelineOperations operations
- :vartype entities_get_timeline:
- azure.mgmt.securityinsight.aio.operations.EntitiesGetTimelineOperations
- :ivar entities_relations: EntitiesRelationsOperations operations
- :vartype entities_relations:
- azure.mgmt.securityinsight.aio.operations.EntitiesRelationsOperations
- :ivar entity_relations: EntityRelationsOperations operations
- :vartype entity_relations: azure.mgmt.securityinsight.aio.operations.EntityRelationsOperations
- :ivar entity_queries: EntityQueriesOperations operations
- :vartype entity_queries: azure.mgmt.securityinsight.aio.operations.EntityQueriesOperations
- :ivar entity_query_templates: EntityQueryTemplatesOperations operations
- :vartype entity_query_templates:
- azure.mgmt.securityinsight.aio.operations.EntityQueryTemplatesOperations
- :ivar file_imports: FileImportsOperations operations
- :vartype file_imports: azure.mgmt.securityinsight.aio.operations.FileImportsOperations
+ :ivar content_packages: ContentPackagesOperations operations
+ :vartype content_packages: azure.mgmt.securityinsight.aio.operations.ContentPackagesOperations
+ :ivar content_package: ContentPackageOperations operations
+ :vartype content_package: azure.mgmt.securityinsight.aio.operations.ContentPackageOperations
+ :ivar product_packages: ProductPackagesOperations operations
+ :vartype product_packages: azure.mgmt.securityinsight.aio.operations.ProductPackagesOperations
+ :ivar product_package: ProductPackageOperations operations
+ :vartype product_package: azure.mgmt.securityinsight.aio.operations.ProductPackageOperations
+ :ivar product_templates: ProductTemplatesOperations operations
+ :vartype product_templates:
+ azure.mgmt.securityinsight.aio.operations.ProductTemplatesOperations
+ :ivar product_template: ProductTemplateOperations operations
+ :vartype product_template: azure.mgmt.securityinsight.aio.operations.ProductTemplateOperations
+ :ivar content_templates: ContentTemplatesOperations operations
+ :vartype content_templates:
+ azure.mgmt.securityinsight.aio.operations.ContentTemplatesOperations
+ :ivar content_template: ContentTemplateOperations operations
+ :vartype content_template: azure.mgmt.securityinsight.aio.operations.ContentTemplateOperations
+ :ivar data_connector_definitions: DataConnectorDefinitionsOperations operations
+ :vartype data_connector_definitions:
+ azure.mgmt.securityinsight.aio.operations.DataConnectorDefinitionsOperations
+ :ivar data_connectors: DataConnectorsOperations operations
+ :vartype data_connectors: azure.mgmt.securityinsight.aio.operations.DataConnectorsOperations
:ivar incident_comments: IncidentCommentsOperations operations
:vartype incident_comments:
azure.mgmt.securityinsight.aio.operations.IncidentCommentsOperations
@@ -113,23 +107,14 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype incident_tasks: azure.mgmt.securityinsight.aio.operations.IncidentTasksOperations
:ivar metadata: MetadataOperations operations
:vartype metadata: azure.mgmt.securityinsight.aio.operations.MetadataOperations
- :ivar office_consents: OfficeConsentsOperations operations
- :vartype office_consents: azure.mgmt.securityinsight.aio.operations.OfficeConsentsOperations
:ivar sentinel_onboarding_states: SentinelOnboardingStatesOperations operations
:vartype sentinel_onboarding_states:
azure.mgmt.securityinsight.aio.operations.SentinelOnboardingStatesOperations
- :ivar get_recommendations: GetRecommendationsOperations operations
- :vartype get_recommendations:
- azure.mgmt.securityinsight.aio.operations.GetRecommendationsOperations
- :ivar get: GetOperations operations
- :vartype get: azure.mgmt.securityinsight.aio.operations.GetOperations
- :ivar update: UpdateOperations operations
- :vartype update: azure.mgmt.securityinsight.aio.operations.UpdateOperations
+ :ivar operations: Operations operations
+ :vartype operations: azure.mgmt.securityinsight.aio.operations.Operations
:ivar security_ml_analytics_settings: SecurityMLAnalyticsSettingsOperations operations
:vartype security_ml_analytics_settings:
azure.mgmt.securityinsight.aio.operations.SecurityMLAnalyticsSettingsOperations
- :ivar product_settings: ProductSettingsOperations operations
- :vartype product_settings: azure.mgmt.securityinsight.aio.operations.ProductSettingsOperations
:ivar source_control: SourceControlOperations operations
:vartype source_control: azure.mgmt.securityinsight.aio.operations.SourceControlOperations
:ivar source_controls: SourceControlsOperations operations
@@ -148,21 +133,14 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype watchlists: azure.mgmt.securityinsight.aio.operations.WatchlistsOperations
:ivar watchlist_items: WatchlistItemsOperations operations
:vartype watchlist_items: azure.mgmt.securityinsight.aio.operations.WatchlistItemsOperations
- :ivar data_connectors: DataConnectorsOperations operations
- :vartype data_connectors: azure.mgmt.securityinsight.aio.operations.DataConnectorsOperations
- :ivar data_connectors_check_requirements: DataConnectorsCheckRequirementsOperations operations
- :vartype data_connectors_check_requirements:
- azure.mgmt.securityinsight.aio.operations.DataConnectorsCheckRequirementsOperations
- :ivar operations: Operations operations
- :vartype operations: azure.mgmt.securityinsight.aio.operations.Operations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
- :param subscription_id: The ID of the target subscription. Required.
+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding
- this default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this
+ default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
@@ -176,7 +154,25 @@ def __init__(
**kwargs: Any
) -> None:
self._config = SecurityInsightsConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
- self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
+ _policies = kwargs.pop("policies", None)
+ if _policies is None:
+ _policies = [
+ policies.RequestIdPolicy(**kwargs),
+ self._config.headers_policy,
+ self._config.user_agent_policy,
+ self._config.proxy_policy,
+ policies.ContentDecodePolicy(**kwargs),
+ AsyncARMAutoResourceProviderRegistrationPolicy(),
+ self._config.redirect_policy,
+ self._config.retry_policy,
+ self._config.authentication_policy,
+ self._config.custom_hook_policy,
+ self._config.logging_policy,
+ policies.DistributedTracingPolicy(**kwargs),
+ policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
+ self._config.http_logging_policy,
+ ]
+ self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
@@ -190,29 +186,33 @@ def __init__(
self.automation_rules = AutomationRulesOperations(
self._client, self._config, self._serialize, self._deserialize
)
+ self.entities = EntitiesOperations(self._client, self._config, self._serialize, self._deserialize)
self.incidents = IncidentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.bookmarks = BookmarksOperations(self._client, self._config, self._serialize, self._deserialize)
- self.bookmark_relations = BookmarkRelationsOperations(
+ self.content_packages = ContentPackagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.bookmark = BookmarkOperations(self._client, self._config, self._serialize, self._deserialize)
- self.ip_geodata = IPGeodataOperations(self._client, self._config, self._serialize, self._deserialize)
- self.domain_whois = DomainWhoisOperations(self._client, self._config, self._serialize, self._deserialize)
- self.entities = EntitiesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.entities_get_timeline = EntitiesGetTimelineOperations(
+ self.content_package = ContentPackageOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.product_packages = ProductPackagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entities_relations = EntitiesRelationsOperations(
+ self.product_package = ProductPackageOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.product_templates = ProductTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entity_relations = EntityRelationsOperations(
+ self.product_template = ProductTemplateOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entity_queries = EntityQueriesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.entity_query_templates = EntityQueryTemplatesOperations(
+ self.content_templates = ContentTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.file_imports = FileImportsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.content_template = ContentTemplateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.data_connector_definitions = DataConnectorDefinitionsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.data_connectors = DataConnectorsOperations(self._client, self._config, self._serialize, self._deserialize)
self.incident_comments = IncidentCommentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
@@ -221,21 +221,13 @@ def __init__(
)
self.incident_tasks = IncidentTasksOperations(self._client, self._config, self._serialize, self._deserialize)
self.metadata = MetadataOperations(self._client, self._config, self._serialize, self._deserialize)
- self.office_consents = OfficeConsentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.sentinel_onboarding_states = SentinelOnboardingStatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.get_recommendations = GetRecommendationsOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
- self.get = GetOperations(self._client, self._config, self._serialize, self._deserialize)
- self.update = UpdateOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.security_ml_analytics_settings = SecurityMLAnalyticsSettingsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.product_settings = ProductSettingsOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
self.source_control = SourceControlOperations(self._client, self._config, self._serialize, self._deserialize)
self.source_controls = SourceControlsOperations(self._client, self._config, self._serialize, self._deserialize)
self.threat_intelligence_indicator = ThreatIntelligenceIndicatorOperations(
@@ -249,13 +241,10 @@ def __init__(
)
self.watchlists = WatchlistsOperations(self._client, self._config, self._serialize, self._deserialize)
self.watchlist_items = WatchlistItemsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.data_connectors = DataConnectorsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.data_connectors_check_requirements = DataConnectorsCheckRequirementsOperations(
- self._client, self._config, self._serialize, self._deserialize
- )
- self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
- def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
+ def _send_request(
+ self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
+ ) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@@ -275,14 +264,14 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH
request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
- return self._client.send_request(request_copy, **kwargs)
+ return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
async def close(self) -> None:
await self._client.close()
- async def __aenter__(self) -> "SecurityInsights":
+ async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
- async def __aexit__(self, *exc_details) -> None:
+ async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/__init__.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/__init__.py
index 802d895ef601..6d97243ca023 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/__init__.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/__init__.py
@@ -5,48 +5,47 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._alert_rules_operations import AlertRulesOperations
-from ._actions_operations import ActionsOperations
-from ._alert_rule_templates_operations import AlertRuleTemplatesOperations
-from ._automation_rules_operations import AutomationRulesOperations
-from ._incidents_operations import IncidentsOperations
-from ._bookmarks_operations import BookmarksOperations
-from ._bookmark_relations_operations import BookmarkRelationsOperations
-from ._bookmark_operations import BookmarkOperations
-from ._ip_geodata_operations import IPGeodataOperations
-from ._domain_whois_operations import DomainWhoisOperations
-from ._entities_operations import EntitiesOperations
-from ._entities_get_timeline_operations import EntitiesGetTimelineOperations
-from ._entities_relations_operations import EntitiesRelationsOperations
-from ._entity_relations_operations import EntityRelationsOperations
-from ._entity_queries_operations import EntityQueriesOperations
-from ._entity_query_templates_operations import EntityQueryTemplatesOperations
-from ._file_imports_operations import FileImportsOperations
-from ._incident_comments_operations import IncidentCommentsOperations
-from ._incident_relations_operations import IncidentRelationsOperations
-from ._incident_tasks_operations import IncidentTasksOperations
-from ._metadata_operations import MetadataOperations
-from ._office_consents_operations import OfficeConsentsOperations
-from ._sentinel_onboarding_states_operations import SentinelOnboardingStatesOperations
-from ._get_recommendations_operations import GetRecommendationsOperations
-from ._get_operations import GetOperations
-from ._update_operations import UpdateOperations
-from ._security_ml_analytics_settings_operations import SecurityMLAnalyticsSettingsOperations
-from ._product_settings_operations import ProductSettingsOperations
-from ._source_control_operations import SourceControlOperations
-from ._source_controls_operations import SourceControlsOperations
-from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations
-from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations
-from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations
-from ._watchlists_operations import WatchlistsOperations
-from ._watchlist_items_operations import WatchlistItemsOperations
-from ._data_connectors_operations import DataConnectorsOperations
-from ._data_connectors_check_requirements_operations import DataConnectorsCheckRequirementsOperations
-from ._operations import Operations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._alert_rules_operations import AlertRulesOperations # type: ignore
+from ._actions_operations import ActionsOperations # type: ignore
+from ._alert_rule_templates_operations import AlertRuleTemplatesOperations # type: ignore
+from ._automation_rules_operations import AutomationRulesOperations # type: ignore
+from ._entities_operations import EntitiesOperations # type: ignore
+from ._incidents_operations import IncidentsOperations # type: ignore
+from ._bookmarks_operations import BookmarksOperations # type: ignore
+from ._content_packages_operations import ContentPackagesOperations # type: ignore
+from ._content_package_operations import ContentPackageOperations # type: ignore
+from ._product_packages_operations import ProductPackagesOperations # type: ignore
+from ._product_package_operations import ProductPackageOperations # type: ignore
+from ._product_templates_operations import ProductTemplatesOperations # type: ignore
+from ._product_template_operations import ProductTemplateOperations # type: ignore
+from ._content_templates_operations import ContentTemplatesOperations # type: ignore
+from ._content_template_operations import ContentTemplateOperations # type: ignore
+from ._data_connector_definitions_operations import DataConnectorDefinitionsOperations # type: ignore
+from ._data_connectors_operations import DataConnectorsOperations # type: ignore
+from ._incident_comments_operations import IncidentCommentsOperations # type: ignore
+from ._incident_relations_operations import IncidentRelationsOperations # type: ignore
+from ._incident_tasks_operations import IncidentTasksOperations # type: ignore
+from ._metadata_operations import MetadataOperations # type: ignore
+from ._sentinel_onboarding_states_operations import SentinelOnboardingStatesOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._security_ml_analytics_settings_operations import SecurityMLAnalyticsSettingsOperations # type: ignore
+from ._source_control_operations import SourceControlOperations # type: ignore
+from ._source_controls_operations import SourceControlsOperations # type: ignore
+from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations # type: ignore
+from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations # type: ignore
+from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations # type: ignore
+from ._watchlists_operations import WatchlistsOperations # type: ignore
+from ._watchlist_items_operations import WatchlistItemsOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -54,30 +53,26 @@
"ActionsOperations",
"AlertRuleTemplatesOperations",
"AutomationRulesOperations",
+ "EntitiesOperations",
"IncidentsOperations",
"BookmarksOperations",
- "BookmarkRelationsOperations",
- "BookmarkOperations",
- "IPGeodataOperations",
- "DomainWhoisOperations",
- "EntitiesOperations",
- "EntitiesGetTimelineOperations",
- "EntitiesRelationsOperations",
- "EntityRelationsOperations",
- "EntityQueriesOperations",
- "EntityQueryTemplatesOperations",
- "FileImportsOperations",
+ "ContentPackagesOperations",
+ "ContentPackageOperations",
+ "ProductPackagesOperations",
+ "ProductPackageOperations",
+ "ProductTemplatesOperations",
+ "ProductTemplateOperations",
+ "ContentTemplatesOperations",
+ "ContentTemplateOperations",
+ "DataConnectorDefinitionsOperations",
+ "DataConnectorsOperations",
"IncidentCommentsOperations",
"IncidentRelationsOperations",
"IncidentTasksOperations",
"MetadataOperations",
- "OfficeConsentsOperations",
"SentinelOnboardingStatesOperations",
- "GetRecommendationsOperations",
- "GetOperations",
- "UpdateOperations",
+ "Operations",
"SecurityMLAnalyticsSettingsOperations",
- "ProductSettingsOperations",
"SourceControlOperations",
"SourceControlsOperations",
"ThreatIntelligenceIndicatorOperations",
@@ -85,9 +80,6 @@
"ThreatIntelligenceIndicatorMetricsOperations",
"WatchlistsOperations",
"WatchlistItemsOperations",
- "DataConnectorsOperations",
- "DataConnectorsCheckRequirementsOperations",
- "Operations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_actions_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_actions_operations.py
index 9e3b782688be..dda089114d96 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_actions_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_actions_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._actions_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_by_alert_rule_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -76,7 +74,6 @@ def list_by_alert_rule(
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ActionResponse or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.ActionResponse]
@@ -85,12 +82,10 @@ def list_by_alert_rule(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ActionsList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -101,18 +96,16 @@ def list_by_alert_rule(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_by_alert_rule_request(
+ _request = build_list_by_alert_rule_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_by_alert_rule.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -124,13 +117,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ActionsList", pipeline_response)
@@ -140,10 +132,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -155,10 +148,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list_by_alert_rule.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
@@ -174,12 +163,11 @@ async def get(
:type rule_id: str
:param action_id: Action ID. Required.
:type action_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -190,27 +178,24 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ActionResponse] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
action_id=action_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -219,16 +204,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ActionResponse", pipeline_response)
+ deserialized = self._deserialize("ActionResponse", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -258,7 +239,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
@@ -271,7 +251,7 @@ async def create_or_update(
workspace_name: str,
rule_id: str,
action_id: str,
- action: IO,
+ action: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -288,11 +268,10 @@ async def create_or_update(
:param action_id: Action ID. Required.
:type action_id: str
:param action: The action. Required.
- :type action: IO
+ :type action: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
@@ -305,7 +284,7 @@ async def create_or_update(
workspace_name: str,
rule_id: str,
action_id: str,
- action: Union[_models.ActionRequest, IO],
+ action: Union[_models.ActionRequest, IO[bytes]],
**kwargs: Any
) -> _models.ActionResponse:
"""Creates or updates the action of alert rule.
@@ -319,17 +298,13 @@ async def create_or_update(
:type rule_id: str
:param action_id: Action ID. Required.
:type action_id: str
- :param action: The action. Is either a model type or a IO type. Required.
- :type action: ~azure.mgmt.securityinsight.models.ActionRequest or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param action: The action. Is either a ActionRequest type or a IO[bytes] type. Required.
+ :type action: ~azure.mgmt.securityinsight.models.ActionRequest or IO[bytes]
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -340,21 +315,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ActionResponse] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(action, (IO, bytes)):
+ if isinstance(action, (IOBase, bytes)):
_content = action
else:
_json = self._serialize.body(action, "ActionRequest")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
@@ -364,15 +337,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -381,23 +353,15 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("ActionResponse", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("ActionResponse", pipeline_response)
+ deserialized = self._deserialize("ActionResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
) -> None:
"""Delete the action of alert rule.
@@ -411,12 +375,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type rule_id: str
:param action_id: Action ID. Required.
:type action_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -427,27 +390,24 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
action_id=action_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -457,8 +417,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_templates_operations.py
index c4517e99abe7..47eaa9ef30d1 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_templates_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_templates_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,21 +19,19 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._alert_rule_templates_operations import build_get_request, build_list_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -69,7 +66,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AlertRuleTemplate or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
@@ -78,12 +74,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRuleTemplatesList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -94,17 +88,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -116,13 +108,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("AlertRuleTemplatesList", pipeline_response)
@@ -132,10 +123,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -147,10 +139,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, alert_rule_template_id: str, **kwargs: Any
@@ -164,12 +152,11 @@ async def get(
:type workspace_name: str
:param alert_rule_template_id: Alert rule template ID. Required.
:type alert_rule_template_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRuleTemplate or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRuleTemplate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -180,26 +167,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRuleTemplate] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
alert_rule_template_id=alert_rule_template_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -208,13 +192,9 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AlertRuleTemplate", pipeline_response)
+ deserialized = self._deserialize("AlertRuleTemplate", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rules_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rules_operations.py
index 856b3843f35a..fde8ffd614c9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rules_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._alert_rules_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -72,7 +70,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AlertRule or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.AlertRule]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -80,12 +77,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRulesList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -96,17 +91,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -118,13 +111,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("AlertRulesList", pipeline_response)
@@ -134,10 +126,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -149,10 +142,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any
@@ -166,12 +155,11 @@ async def get(
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,26 +170,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRule] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -210,16 +195,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AlertRule", pipeline_response)
+ deserialized = self._deserialize("AlertRule", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -246,7 +227,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -258,7 +238,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
rule_id: str,
- alert_rule: IO,
+ alert_rule: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -273,11 +253,10 @@ async def create_or_update(
:param rule_id: Alert rule ID. Required.
:type rule_id: str
:param alert_rule: The alert rule. Required.
- :type alert_rule: IO
+ :type alert_rule: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -289,7 +268,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
rule_id: str,
- alert_rule: Union[_models.AlertRule, IO],
+ alert_rule: Union[_models.AlertRule, IO[bytes]],
**kwargs: Any
) -> _models.AlertRule:
"""Creates or updates the alert rule.
@@ -301,17 +280,13 @@ async def create_or_update(
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :param alert_rule: The alert rule. Is either a model type or a IO type. Required.
- :type alert_rule: ~azure.mgmt.securityinsight.models.AlertRule or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param alert_rule: The alert rule. Is either a AlertRule type or a IO[bytes] type. Required.
+ :type alert_rule: ~azure.mgmt.securityinsight.models.AlertRule or IO[bytes]
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -322,21 +297,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AlertRule] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(alert_rule, (IO, bytes)):
+ if isinstance(alert_rule, (IOBase, bytes)):
_content = alert_rule
else:
_json = self._serialize.body(alert_rule, "AlertRule")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
@@ -345,15 +318,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -362,25 +334,15 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("AlertRule", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("AlertRule", pipeline_response)
+ deserialized = self._deserialize("AlertRule", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any) -> None:
"""Delete the alert rule.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -390,12 +352,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,26 +367,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -435,8 +393,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_automation_rules_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_automation_rules_operations.py
index 9040a09fd9bf..c4d063265993 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_automation_rules_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_automation_rules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._automation_rules_operations import (
build_create_or_update_request,
build_delete_request,
@@ -39,11 +37,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -81,12 +75,11 @@ async def get(
:type workspace_name: str
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -97,26 +90,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AutomationRule] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
automation_rule_id=automation_rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -125,16 +115,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AutomationRule", pipeline_response)
+ deserialized = self._deserialize("AutomationRule", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -161,7 +147,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -173,7 +158,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
automation_rule_id: str,
- automation_rule_to_upsert: Optional[IO] = None,
+ automation_rule_to_upsert: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
@@ -188,11 +173,10 @@ async def create_or_update(
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
:param automation_rule_to_upsert: The automation rule. Default value is None.
- :type automation_rule_to_upsert: IO
+ :type automation_rule_to_upsert: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -204,7 +188,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
automation_rule_id: str,
- automation_rule_to_upsert: Optional[Union[_models.AutomationRule, IO]] = None,
+ automation_rule_to_upsert: Optional[Union[_models.AutomationRule, IO[bytes]]] = None,
**kwargs: Any
) -> _models.AutomationRule:
"""Creates or updates the automation rule.
@@ -216,18 +200,14 @@ async def create_or_update(
:type workspace_name: str
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
- :param automation_rule_to_upsert: The automation rule. Is either a model type or a IO type.
- Default value is None.
- :type automation_rule_to_upsert: ~azure.mgmt.securityinsight.models.AutomationRule or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param automation_rule_to_upsert: The automation rule. Is either a AutomationRule type or a
+ IO[bytes] type. Default value is None.
+ :type automation_rule_to_upsert: ~azure.mgmt.securityinsight.models.AutomationRule or IO[bytes]
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -238,16 +218,14 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AutomationRule] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(automation_rule_to_upsert, (IO, bytes)):
+ if isinstance(automation_rule_to_upsert, (IOBase, bytes)):
_content = automation_rule_to_upsert
else:
if automation_rule_to_upsert is not None:
@@ -255,7 +233,7 @@ async def create_or_update(
else:
_json = None
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
automation_rule_id=automation_rule_id,
@@ -264,15 +242,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -281,21 +258,13 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("AutomationRule", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("AutomationRule", pipeline_response)
+ deserialized = self._deserialize("AutomationRule", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
-
@distributed_trace_async
async def delete(
self, resource_group_name: str, workspace_name: str, automation_rule_id: str, **kwargs: Any
@@ -309,12 +278,11 @@ async def delete(
:type workspace_name: str
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: JSON or the result of cls(response)
:rtype: JSON
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -325,26 +293,23 @@ async def delete(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[JSON] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
automation_rule_id=automation_rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -353,21 +318,13 @@ async def delete(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("object", pipeline_response)
-
- if response.status_code == 204:
- deserialized = self._deserialize("object", pipeline_response)
+ deserialized = self._deserialize("object", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
-
@distributed_trace
def list(
self, resource_group_name: str, workspace_name: str, **kwargs: Any
@@ -379,7 +336,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AutomationRule or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.AutomationRule]
@@ -388,12 +344,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AutomationRulesList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,17 +358,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -426,13 +378,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("AutomationRulesList", pipeline_response)
@@ -442,10 +393,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -456,7 +408,3 @@ async def get_next(next_link=None):
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmark_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmark_operations.py
deleted file mode 100644
index e87871dba5df..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmark_operations.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._bookmark_operations import build_expand_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class BookmarkOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`bookmark` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @overload
- async def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- parameters: _models.BookmarkExpandParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BookmarkExpandResponse:
- """Expand an bookmark.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param parameters: The parameters required to execute an expand operation on the given
- bookmark. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.BookmarkExpandParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: BookmarkExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.BookmarkExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- parameters: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BookmarkExpandResponse:
- """Expand an bookmark.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param parameters: The parameters required to execute an expand operation on the given
- bookmark. Required.
- :type parameters: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: BookmarkExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.BookmarkExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- parameters: Union[_models.BookmarkExpandParameters, IO],
- **kwargs: Any
- ) -> _models.BookmarkExpandResponse:
- """Expand an bookmark.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param parameters: The parameters required to execute an expand operation on the given
- bookmark. Is either a model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.BookmarkExpandParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: BookmarkExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.BookmarkExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.BookmarkExpandResponse] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "BookmarkExpandParameters")
-
- request = build_expand_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.expand.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("BookmarkExpandResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- expand.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmark_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmark_relations_operations.py
deleted file mode 100644
index 237aca3682c1..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmark_relations_operations.py
+++ /dev/null
@@ -1,487 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
-import urllib.parse
-
-from azure.core.async_paging import AsyncItemPaged, AsyncList
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._bookmark_relations_operations import (
- build_create_or_update_request,
- build_delete_request,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class BookmarkRelationsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`bookmark_relations` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- filter: Optional[str] = None,
- orderby: Optional[str] = None,
- top: Optional[int] = None,
- skip_token: Optional[str] = None,
- **kwargs: Any
- ) -> AsyncIterable["_models.Relation"]:
- """Gets all bookmark relations.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
- None.
- :type filter: str
- :param orderby: Sorts the results. Optional. Default value is None.
- :type orderby: str
- :param top: Returns only the first n results. Optional. Default value is None.
- :type top: int
- :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
- a previous response contains a nextLink element, the value of the nextLink element will include
- a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
- Default value is None.
- :type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either Relation or the result of cls(response)
- :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Relation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- subscription_id=self._config.subscription_id,
- filter=filter,
- orderby=orderby,
- top=top,
- skip_token=skip_token,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- async def extract_data(pipeline_response):
- deserialized = self._deserialize("RelationList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, AsyncList(list_of_elem)
-
- async def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations"
- }
-
- @distributed_trace_async
- async def get(
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, relation_name: str, **kwargs: Any
- ) -> _models.Relation:
- """Gets a bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}"
- }
-
- @overload
- async def create_or_update(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- relation: _models.Relation,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Relation:
- """Creates the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :param relation: The relation model. Required.
- :type relation: ~azure.mgmt.securityinsight.models.Relation
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def create_or_update(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- relation: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Relation:
- """Creates the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :param relation: The relation model. Required.
- :type relation: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def create_or_update(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- relation: Union[_models.Relation, IO],
- **kwargs: Any
- ) -> _models.Relation:
- """Creates the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :param relation: The relation model. Is either a model type or a IO type. Required.
- :type relation: ~azure.mgmt.securityinsight.models.Relation or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(relation, (IO, bytes)):
- _content = relation
- else:
- _json = self._serialize.body(relation, "Relation")
-
- request = build_create_or_update_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create_or_update.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if response.status_code == 200:
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}"
- }
-
- @distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, relation_name: str, **kwargs: Any
- ) -> None:
- """Delete the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.delete.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmarks_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmarks_operations.py
index b9783e8fa1e7..b4fdf2ddad30 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmarks_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_bookmarks_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._bookmarks_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -72,7 +70,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Bookmark or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Bookmark]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -80,12 +77,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BookmarkList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -96,17 +91,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -118,13 +111,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("BookmarkList", pipeline_response)
@@ -134,10 +126,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -149,10 +142,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any
@@ -166,12 +155,11 @@ async def get(
:type workspace_name: str
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,26 +170,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Bookmark] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -210,16 +195,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Bookmark", pipeline_response)
+ deserialized = self._deserialize("Bookmark", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -246,7 +227,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
@@ -258,7 +238,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
bookmark_id: str,
- bookmark: IO,
+ bookmark: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -273,11 +253,10 @@ async def create_or_update(
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
:param bookmark: The bookmark. Required.
- :type bookmark: IO
+ :type bookmark: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
@@ -289,7 +268,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
bookmark_id: str,
- bookmark: Union[_models.Bookmark, IO],
+ bookmark: Union[_models.Bookmark, IO[bytes]],
**kwargs: Any
) -> _models.Bookmark:
"""Creates or updates the bookmark.
@@ -301,17 +280,13 @@ async def create_or_update(
:type workspace_name: str
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
- :param bookmark: The bookmark. Is either a model type or a IO type. Required.
- :type bookmark: ~azure.mgmt.securityinsight.models.Bookmark or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param bookmark: The bookmark. Is either a Bookmark type or a IO[bytes] type. Required.
+ :type bookmark: ~azure.mgmt.securityinsight.models.Bookmark or IO[bytes]
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -322,21 +297,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Bookmark] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(bookmark, (IO, bytes)):
+ if isinstance(bookmark, (IOBase, bytes)):
_content = bookmark
else:
_json = self._serialize.body(bookmark, "Bookmark")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
@@ -345,15 +318,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -362,25 +334,15 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("Bookmark", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Bookmark", pipeline_response)
+ deserialized = self._deserialize("Bookmark", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any) -> None:
"""Delete the bookmark.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -390,12 +352,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,26 +367,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -435,8 +393,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_package_operations.py
new file mode 100644
index 000000000000..e1a79e5a49f5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_package_operations.py
@@ -0,0 +1,249 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._content_package_operations import build_install_request, build_uninstall_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class ContentPackageOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`content_package` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @overload
+ async def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ package_id: str,
+ package_installation_properties: _models.PackageModel,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.PackageModel:
+ """Install a package to the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :param package_installation_properties: Package installation properties. Required.
+ :type package_installation_properties: ~azure.mgmt.securityinsight.models.PackageModel
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ package_id: str,
+ package_installation_properties: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.PackageModel:
+ """Install a package to the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :param package_installation_properties: Package installation properties. Required.
+ :type package_installation_properties: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ package_id: str,
+ package_installation_properties: Union[_models.PackageModel, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.PackageModel:
+ """Install a package to the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :param package_installation_properties: Package installation properties. Is either a
+ PackageModel type or a IO[bytes] type. Required.
+ :type package_installation_properties: ~azure.mgmt.securityinsight.models.PackageModel or
+ IO[bytes]
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.PackageModel] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(package_installation_properties, (IOBase, bytes)):
+ _content = package_installation_properties
+ else:
+ _json = self._serialize.body(package_installation_properties, "PackageModel")
+
+ _request = build_install_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ package_id=package_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("PackageModel", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def uninstall(self, resource_group_name: str, workspace_name: str, package_id: str, **kwargs: Any) -> None:
+ """Uninstall a package from the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_uninstall_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ package_id=package_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_query_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_packages_operations.py
similarity index 60%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_query_templates_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_packages_operations.py
index e2f34e18fc04..fc6f0430c296 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_query_templates_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_packages_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -20,33 +19,31 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._entity_query_templates_operations import build_get_request, build_list_request
+from ...operations._content_packages_operations import build_get_request, build_list_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class EntityQueryTemplatesOperations:
+class ContentPackagesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`entity_query_templates` attribute.
+ :attr:`content_packages` attribute.
"""
models = _models
@@ -63,33 +60,54 @@ def list(
self,
resource_group_name: str,
workspace_name: str,
- kind: Optional[Union[str, _models.Enum15]] = None,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
**kwargs: Any
- ) -> AsyncIterable["_models.EntityQueryTemplate"]:
- """Gets all entity query templates.
+ ) -> AsyncIterable["_models.PackageModel"]:
+ """Gets all installed packages.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param kind: The entity template query kind we want to fetch. "Activity" Default value is None.
- :type kind: str or ~azure.mgmt.securityinsight.models.Enum15
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either EntityQueryTemplate or the result of cls(response)
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: str
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :param count: Instructs the server to return only object count without actual body. Optional.
+ Default value is None.
+ :type count: bool
+ :param top: Returns only the first n results. Optional. Default value is None.
+ :type top: int
+ :param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
+ next page of results if there are any left. Default value is None.
+ :type skip: int
+ :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
+ a previous response contains a nextLink element, the value of the nextLink element will include
+ a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
+ Default value is None.
+ :type skip_token: str
+ :return: An iterator like instance of either PackageModel or the result of cls(response)
:rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.PackageModel]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQueryTemplateList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.PackageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -100,18 +118,22 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
- kind=kind,
+ filter=filter,
+ orderby=orderby,
+ search=search,
+ count=count,
+ top=top,
+ skip=skip,
+ skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -123,26 +145,26 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
- deserialized = self._deserialize("EntityQueryTemplateList", pipeline_response)
+ deserialized = self._deserialize("PackageList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -154,29 +176,24 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates"
- }
-
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, entity_query_template_id: str, **kwargs: Any
- ) -> _models.EntityQueryTemplate:
- """Gets an entity query.
+ self, resource_group_name: str, workspace_name: str, package_id: str, **kwargs: Any
+ ) -> _models.PackageModel:
+ """Gets an installed packages by its id.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_template_id: entity query template ID. Required.
- :type entity_query_template_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQueryTemplate or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQueryTemplate
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -187,26 +204,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQueryTemplate] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.PackageModel] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_template_id=entity_query_template_id,
+ package_id=package_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -215,13 +229,9 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EntityQueryTemplate", pipeline_response)
+ deserialized = self._deserialize("PackageModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_template_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_template_operations.py
new file mode 100644
index 000000000000..66850a1472c9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_template_operations.py
@@ -0,0 +1,314 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._content_template_operations import build_delete_request, build_get_request, build_install_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class ContentTemplateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`content_template` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @overload
+ async def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ template_id: str,
+ template_installation_properties: _models.TemplateModel,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Install a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :param template_installation_properties: Template installation properties. Required.
+ :type template_installation_properties: ~azure.mgmt.securityinsight.models.TemplateModel
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ template_id: str,
+ template_installation_properties: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Install a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :param template_installation_properties: Template installation properties. Required.
+ :type template_installation_properties: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ template_id: str,
+ template_installation_properties: Union[_models.TemplateModel, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Install a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :param template_installation_properties: Template installation properties. Is either a
+ TemplateModel type or a IO[bytes] type. Required.
+ :type template_installation_properties: ~azure.mgmt.securityinsight.models.TemplateModel or
+ IO[bytes]
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.TemplateModel] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(template_installation_properties, (IOBase, bytes)):
+ _content = template_installation_properties
+ else:
+ _json = self._serialize.body(template_installation_properties, "TemplateModel")
+
+ _request = build_install_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ template_id=template_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TemplateModel", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def get(
+ self, resource_group_name: str, workspace_name: str, template_id: str, **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Gets a template byt its identifier.
+ Expandable properties:
+
+
+ * properties/mainTemplate
+ * properties/dependantTemplates.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.TemplateModel] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ template_id=template_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TemplateModel", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def delete(self, resource_group_name: str, workspace_name: str, template_id: str, **kwargs: Any) -> None:
+ """Delete an installed template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ template_id=template_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_templates_operations.py
new file mode 100644
index 000000000000..c9b8dfb665d2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_templates_operations.py
@@ -0,0 +1,186 @@
+# 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 sys
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._content_templates_operations import build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class ContentTemplatesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`content_templates` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ expand: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.TemplateModel"]:
+ """Gets all installed templates.
+ Expandable properties:
+
+
+ * properties/mainTemplate
+ * properties/dependantTemplates.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: str
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
+ :param expand: Expands the object with optional fiends that are not included by default.
+ Optional. Default value is None.
+ :type expand: str
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :param count: Instructs the server to return only object count without actual body. Optional.
+ Default value is None.
+ :type count: bool
+ :param top: Returns only the first n results. Optional. Default value is None.
+ :type top: int
+ :param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
+ next page of results if there are any left. Default value is None.
+ :type skip: int
+ :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
+ a previous response contains a nextLink element, the value of the nextLink element will include
+ a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
+ Default value is None.
+ :type skip_token: str
+ :return: An iterator like instance of either TemplateModel or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.TemplateModel]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.TemplateList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ expand=expand,
+ search=search,
+ count=count,
+ top=top,
+ skip=skip,
+ skip_token=skip_token,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("TemplateList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_queries_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connector_definitions_operations.py
similarity index 57%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_queries_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connector_definitions_operations.py
index 2a53846738ea..5493c2f23e87 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_queries_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connector_definitions_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,38 +20,36 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._entity_queries_operations import (
+from ...operations._data_connector_definitions_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class EntityQueriesOperations:
+class DataConnectorDefinitionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`entity_queries` attribute.
+ :attr:`data_connector_definitions` attribute.
"""
models = _models
@@ -65,36 +63,28 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- kind: Optional[Union[str, _models.Enum13]] = None,
- **kwargs: Any
- ) -> AsyncIterable["_models.EntityQuery"]:
- """Gets all entity queries.
+ self, resource_group_name: str, workspace_name: str, **kwargs: Any
+ ) -> AsyncIterable["_models.DataConnectorDefinition"]:
+ """Gets all data connector definitions.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param kind: The entity query kind we want to fetch. Known values are: "Expansion" and
- "Activity". Default value is None.
- :type kind: str or ~azure.mgmt.securityinsight.models.Enum13
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either EntityQuery or the result of cls(response)
- :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.EntityQuery]
+ :return: An iterator like instance of either DataConnectorDefinition or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.DataConnectorDefinition]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQueryList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.DataConnectorDefinitionArmCollectionWrapper] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -105,18 +95,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
- kind=kind,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -128,26 +115,26 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
- deserialized = self._deserialize("EntityQueryList", pipeline_response)
+ deserialized = self._deserialize("DataConnectorDefinitionArmCollectionWrapper", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -159,29 +146,24 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries"
- }
-
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, entity_query_id: str, **kwargs: Any
- ) -> _models.EntityQuery:
- """Gets an entity query.
+ self, resource_group_name: str, workspace_name: str, data_connector_definition_name: str, **kwargs: Any
+ ) -> _models.DataConnectorDefinition:
+ """Gets a data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -192,26 +174,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQuery] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.DataConnectorDefinition] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_id=entity_query_id,
+ data_connector_definition_name=data_connector_definition_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -220,45 +199,40 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EntityQuery", pipeline_response)
+ deserialized = self._deserialize("DataConnectorDefinition", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
- entity_query_id: str,
- entity_query: _models.CustomEntityQuery,
+ data_connector_definition_name: str,
+ connector_definition_input: _models.DataConnectorDefinition,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityQuery:
- """Creates or updates the entity query.
+ ) -> _models.DataConnectorDefinition:
+ """Creates or updates the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :param entity_query: The entity query we want to create or update. Required.
- :type entity_query: ~azure.mgmt.securityinsight.models.CustomEntityQuery
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :param connector_definition_input: The data connector definition. Required.
+ :type connector_definition_input: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -267,29 +241,28 @@ async def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
- entity_query_id: str,
- entity_query: IO,
+ data_connector_definition_name: str,
+ connector_definition_input: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityQuery:
- """Creates or updates the entity query.
+ ) -> _models.DataConnectorDefinition:
+ """Creates or updates the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :param entity_query: The entity query we want to create or update. Required.
- :type entity_query: IO
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :param connector_definition_input: The data connector definition. Required.
+ :type connector_definition_input: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -298,31 +271,28 @@ async def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
- entity_query_id: str,
- entity_query: Union[_models.CustomEntityQuery, IO],
+ data_connector_definition_name: str,
+ connector_definition_input: Union[_models.DataConnectorDefinition, IO[bytes]],
**kwargs: Any
- ) -> _models.EntityQuery:
- """Creates or updates the entity query.
+ ) -> _models.DataConnectorDefinition:
+ """Creates or updates the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :param entity_query: The entity query we want to create or update. Is either a model type or a
- IO type. Required.
- :type entity_query: ~azure.mgmt.securityinsight.models.CustomEntityQuery or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :param connector_definition_input: The data connector definition. Is either a
+ DataConnectorDefinition type or a IO[bytes] type. Required.
+ :type connector_definition_input: ~azure.mgmt.securityinsight.models.DataConnectorDefinition or
+ IO[bytes]
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -333,38 +303,35 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityQuery] = kwargs.pop("cls", None)
+ cls: ClsType[_models.DataConnectorDefinition] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(entity_query, (IO, bytes)):
- _content = entity_query
+ if isinstance(connector_definition_input, (IOBase, bytes)):
+ _content = connector_definition_input
else:
- _json = self._serialize.body(entity_query, "CustomEntityQuery")
+ _json = self._serialize.body(connector_definition_input, "DataConnectorDefinition")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_id=entity_query_id,
+ data_connector_definition_name=data_connector_definition_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -373,40 +340,31 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("EntityQuery", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("EntityQuery", pipeline_response)
+ deserialized = self._deserialize("DataConnectorDefinition", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, entity_query_id: str, **kwargs: Any
+ async def delete(
+ self, resource_group_name: str, workspace_name: str, data_connector_definition_name: str, **kwargs: Any
) -> None:
- """Delete the entity query.
+ """Delete the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -417,26 +375,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_id=entity_query_id,
+ data_connector_definition_name=data_connector_definition_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -446,8 +401,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_check_requirements_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_check_requirements_operations.py
deleted file mode 100644
index ad27dbca1787..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_check_requirements_operations.py
+++ /dev/null
@@ -1,203 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._data_connectors_check_requirements_operations import build_post_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class DataConnectorsCheckRequirementsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`data_connectors_check_requirements` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @overload
- async def post(
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connectors_check_requirements: _models.DataConnectorsCheckRequirements,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.DataConnectorRequirementsState:
- """Get requirements state for a data connector type.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connectors_check_requirements: The parameters for requirements check message.
- Required.
- :type data_connectors_check_requirements:
- ~azure.mgmt.securityinsight.models.DataConnectorsCheckRequirements
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: DataConnectorRequirementsState or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.DataConnectorRequirementsState
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def post(
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connectors_check_requirements: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.DataConnectorRequirementsState:
- """Get requirements state for a data connector type.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connectors_check_requirements: The parameters for requirements check message.
- Required.
- :type data_connectors_check_requirements: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: DataConnectorRequirementsState or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.DataConnectorRequirementsState
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def post(
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connectors_check_requirements: Union[_models.DataConnectorsCheckRequirements, IO],
- **kwargs: Any
- ) -> _models.DataConnectorRequirementsState:
- """Get requirements state for a data connector type.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connectors_check_requirements: The parameters for requirements check message. Is
- either a model type or a IO type. Required.
- :type data_connectors_check_requirements:
- ~azure.mgmt.securityinsight.models.DataConnectorsCheckRequirements or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: DataConnectorRequirementsState or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.DataConnectorRequirementsState
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.DataConnectorRequirementsState] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(data_connectors_check_requirements, (IO, bytes)):
- _content = data_connectors_check_requirements
- else:
- _json = self._serialize.body(data_connectors_check_requirements, "DataConnectorsCheckRequirements")
-
- request = build_post_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.post.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("DataConnectorRequirementsState", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- post.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py
index 3e9a9ea01f82..aa57a75f4489 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,28 +20,24 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._data_connectors_operations import (
- build_connect_request,
build_create_or_update_request,
build_delete_request,
- build_disconnect_request,
build_get_request,
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -76,7 +72,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DataConnector or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.DataConnector]
@@ -85,12 +80,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DataConnectorList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -101,17 +94,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -123,13 +114,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("DataConnectorList", pipeline_response)
@@ -139,10 +129,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -154,10 +145,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
@@ -171,12 +158,11 @@ async def get(
:type workspace_name: str
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -187,26 +173,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DataConnector] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -215,16 +198,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("DataConnector", pipeline_response)
+ deserialized = self._deserialize("DataConnector", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -251,7 +230,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
@@ -263,7 +241,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
data_connector_id: str,
- data_connector: IO,
+ data_connector: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -278,11 +256,10 @@ async def create_or_update(
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
:param data_connector: The data connector. Required.
- :type data_connector: IO
+ :type data_connector: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
@@ -294,7 +271,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
data_connector_id: str,
- data_connector: Union[_models.DataConnector, IO],
+ data_connector: Union[_models.DataConnector, IO[bytes]],
**kwargs: Any
) -> _models.DataConnector:
"""Creates or updates the data connector.
@@ -306,17 +283,14 @@ async def create_or_update(
:type workspace_name: str
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
- :param data_connector: The data connector. Is either a model type or a IO type. Required.
- :type data_connector: ~azure.mgmt.securityinsight.models.DataConnector or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param data_connector: The data connector. Is either a DataConnector type or a IO[bytes] type.
+ Required.
+ :type data_connector: ~azure.mgmt.securityinsight.models.DataConnector or IO[bytes]
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -327,21 +301,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DataConnector] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(data_connector, (IO, bytes)):
+ if isinstance(data_connector, (IOBase, bytes)):
_content = data_connector
else:
_json = self._serialize.body(data_connector, "DataConnector")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
@@ -350,15 +322,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -367,23 +338,15 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("DataConnector", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("DataConnector", pipeline_response)
+ deserialized = self._deserialize("DataConnector", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
) -> None:
"""Delete the data connector.
@@ -395,12 +358,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -411,26 +373,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -440,220 +399,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
-
- @overload
- async def connect( # pylint: disable=inconsistent-return-statements
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connector_id: str,
- connect_body: _models.DataConnectorConnectBody,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> None:
- """Connects a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :param connect_body: The data connector. Required.
- :type connect_body: ~azure.mgmt.securityinsight.models.DataConnectorConnectBody
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def connect( # pylint: disable=inconsistent-return-statements
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connector_id: str,
- connect_body: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> None:
- """Connects a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :param connect_body: The data connector. Required.
- :type connect_body: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def connect( # pylint: disable=inconsistent-return-statements
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connector_id: str,
- connect_body: Union[_models.DataConnectorConnectBody, IO],
- **kwargs: Any
- ) -> None:
- """Connects a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :param connect_body: The data connector. Is either a model type or a IO type. Required.
- :type connect_body: ~azure.mgmt.securityinsight.models.DataConnectorConnectBody or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(connect_body, (IO, bytes)):
- _content = connect_body
- else:
- _json = self._serialize.body(connect_body, "DataConnectorConnectBody")
-
- request = build_connect_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- data_connector_id=data_connector_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.connect.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- connect.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect"
- }
-
- @distributed_trace_async
- async def disconnect( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
- ) -> None:
- """Disconnect a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_disconnect_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- data_connector_id=data_connector_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.disconnect.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- disconnect.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_get_timeline_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_get_timeline_operations.py
deleted file mode 100644
index 62111c6a7259..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_get_timeline_operations.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._entities_get_timeline_operations import build_list_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class EntitiesGetTimelineOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`entities_get_timeline` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @overload
- async def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: _models.EntityTimelineParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityTimelineResponse:
- """Timeline for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an timeline operation on the given
- entity. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityTimelineParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityTimelineResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityTimelineResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityTimelineResponse:
- """Timeline for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an timeline operation on the given
- entity. Required.
- :type parameters: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityTimelineResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityTimelineResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: Union[_models.EntityTimelineParameters, IO],
- **kwargs: Any
- ) -> _models.EntityTimelineResponse:
- """Timeline for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an timeline operation on the given
- entity. Is either a model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityTimelineParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityTimelineResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityTimelineResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityTimelineResponse] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "EntityTimelineParameters")
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EntityTimelineResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_operations.py
index ddabc83cb09f..b9188c7311a4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,11 +5,10 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
-import urllib.parse
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
@@ -20,27 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._entities_operations import (
- build_expand_request,
- build_get_insights_request,
- build_get_request,
- build_list_request,
- build_queries_request,
-)
+from ...operations._entities_operations import build_run_playbook_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -64,256 +53,95 @@ def __init__(self, *args, **kwargs) -> None:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- @distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> AsyncIterable["_models.Entity"]:
- """Gets all entities.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either Entity or the result of cls(response)
- :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Entity]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- async def extract_data(pipeline_response):
- deserialized = self._deserialize("EntityList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, AsyncList(list_of_elem)
-
- async def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities"
- }
-
- @distributed_trace_async
- async def get(self, resource_group_name: str, workspace_name: str, entity_id: str, **kwargs: Any) -> _models.Entity:
- """Gets an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Entity or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Entity
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Entity] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Entity", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}"
- }
-
@overload
- async def expand(
+ async def run_playbook(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
- parameters: _models.EntityExpandParameters,
+ entity_identifier: str,
+ request_body: Optional[_models.EntityManualTriggerRequestBody] = None,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityExpandResponse:
- """Expands an entity.
+ ) -> None:
+ """Triggers playbook on a specific entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an expand operation on the given entity.
- Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityExpandParameters
+ :param entity_identifier: Entity ID. Required.
+ :type entity_identifier: str
+ :param request_body: Describes the request body for triggering a playbook on an entity. Default
+ value is None.
+ :type request_body: ~azure.mgmt.securityinsight.models.EntityManualTriggerRequestBody
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityExpandResponse
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- async def expand(
+ async def run_playbook(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
- parameters: IO,
+ entity_identifier: str,
+ request_body: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityExpandResponse:
- """Expands an entity.
+ ) -> None:
+ """Triggers playbook on a specific entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an expand operation on the given entity.
- Required.
- :type parameters: IO
+ :param entity_identifier: Entity ID. Required.
+ :type entity_identifier: str
+ :param request_body: Describes the request body for triggering a playbook on an entity. Default
+ value is None.
+ :type request_body: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityExpandResponse
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
- async def expand(
+ async def run_playbook(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
- parameters: Union[_models.EntityExpandParameters, IO],
+ entity_identifier: str,
+ request_body: Optional[Union[_models.EntityManualTriggerRequestBody, IO[bytes]]] = None,
**kwargs: Any
- ) -> _models.EntityExpandResponse:
- """Expands an entity.
+ ) -> None:
+ """Triggers playbook on a specific entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an expand operation on the given entity.
- Is either a model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityExpandParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityExpandResponse
+ :param entity_identifier: Entity ID. Required.
+ :type entity_identifier: str
+ :param request_body: Describes the request body for triggering a playbook on an entity. Is
+ either a EntityManualTriggerRequestBody type or a IO[bytes] type. Default value is None.
+ :type request_body: ~azure.mgmt.securityinsight.models.EntityManualTriggerRequestBody or
+ IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -324,282 +152,45 @@ async def expand(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityExpandResponse] = kwargs.pop("cls", None)
+ cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
+ if isinstance(request_body, (IOBase, bytes)):
+ _content = request_body
else:
- _json = self._serialize.body(parameters, "EntityExpandParameters")
-
- request = build_expand_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.expand.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EntityExpandResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- expand.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand"
- }
-
- @distributed_trace_async
- async def queries(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- kind: Union[str, _models.EntityItemQueryKind],
- **kwargs: Any
- ) -> _models.GetQueriesResponse:
- """Get Insights and Activities for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param kind: The Kind parameter for queries. "Insight" Required.
- :type kind: str or ~azure.mgmt.securityinsight.models.EntityItemQueryKind
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: GetQueriesResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.GetQueriesResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.GetQueriesResponse] = kwargs.pop("cls", None)
-
- request = build_queries_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- kind=kind,
- api_version=api_version,
- template_url=self.queries.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("GetQueriesResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- queries.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries"
- }
-
- @overload
- async def get_insights(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: _models.EntityGetInsightsParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityGetInsightsResponse:
- """Execute Insights for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute insights on the given entity. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityGetInsightsParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityGetInsightsResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityGetInsightsResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def get_insights(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityGetInsightsResponse:
- """Execute Insights for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute insights on the given entity. Required.
- :type parameters: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityGetInsightsResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityGetInsightsResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def get_insights(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: Union[_models.EntityGetInsightsParameters, IO],
- **kwargs: Any
- ) -> _models.EntityGetInsightsResponse:
- """Execute Insights for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute insights on the given entity. Is either a
- model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityGetInsightsParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityGetInsightsResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityGetInsightsResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityGetInsightsResponse] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "EntityGetInsightsParameters")
+ if request_body is not None:
+ _json = self._serialize.body(request_body, "EntityManualTriggerRequestBody")
+ else:
+ _json = None
- request = build_get_insights_request(
+ _request = build_run_playbook_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_id=entity_id,
+ entity_identifier=entity_identifier,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
- template_url=self.get_insights.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200]:
+ if response.status_code not in [204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EntityGetInsightsResponse", pipeline_response)
-
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get_insights.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_relations_operations.py
deleted file mode 100644
index 9cb8ac64c04b..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entity_relations_operations.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, Optional, TypeVar
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._entity_relations_operations import build_get_relation_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class EntityRelationsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`entity_relations` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace_async
- async def get_relation(
- self, resource_group_name: str, workspace_name: str, entity_id: str, relation_name: str, **kwargs: Any
- ) -> _models.Relation:
- """Gets an entity relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
-
- request = build_get_relation_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get_relation.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get_relation.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations/{relationName}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_file_imports_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_file_imports_operations.py
deleted file mode 100644
index 5636b9487428..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_file_imports_operations.py
+++ /dev/null
@@ -1,532 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
-import urllib.parse
-
-from azure.core.async_paging import AsyncItemPaged, AsyncList
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._file_imports_operations import (
- build_create_request,
- build_delete_request,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class FileImportsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`file_imports` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- filter: Optional[str] = None,
- orderby: Optional[str] = None,
- top: Optional[int] = None,
- skip_token: Optional[str] = None,
- **kwargs: Any
- ) -> AsyncIterable["_models.FileImport"]:
- """Gets all file imports.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
- None.
- :type filter: str
- :param orderby: Sorts the results. Optional. Default value is None.
- :type orderby: str
- :param top: Returns only the first n results. Optional. Default value is None.
- :type top: int
- :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
- a previous response contains a nextLink element, the value of the nextLink element will include
- a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
- Default value is None.
- :type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either FileImport or the result of cls(response)
- :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.FileImport]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.FileImportList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- filter=filter,
- orderby=orderby,
- top=top,
- skip_token=skip_token,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- async def extract_data(pipeline_response):
- deserialized = self._deserialize("FileImportList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, AsyncList(list_of_elem)
-
- async def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports"
- }
-
- @distributed_trace_async
- async def get(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
- ) -> _models.FileImport:
- """Gets a file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("FileImport", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
-
- @overload
- async def create(
- self,
- resource_group_name: str,
- workspace_name: str,
- file_import_id: str,
- file_import: _models.FileImport,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.FileImport:
- """Creates the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :param file_import: The file import. Required.
- :type file_import: ~azure.mgmt.securityinsight.models.FileImport
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def create(
- self,
- resource_group_name: str,
- workspace_name: str,
- file_import_id: str,
- file_import: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.FileImport:
- """Creates the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :param file_import: The file import. Required.
- :type file_import: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def create(
- self,
- resource_group_name: str,
- workspace_name: str,
- file_import_id: str,
- file_import: Union[_models.FileImport, IO],
- **kwargs: Any
- ) -> _models.FileImport:
- """Creates the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :param file_import: The file import. Is either a model type or a IO type. Required.
- :type file_import: ~azure.mgmt.securityinsight.models.FileImport or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(file_import, (IO, bytes)):
- _content = file_import
- else:
- _json = self._serialize.body(file_import, "FileImport")
-
- request = build_create_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("FileImport", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
-
- async def _delete_initial(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
- ) -> Optional[_models.FileImport]:
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[Optional[_models.FileImport]] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self._delete_initial.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [202, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = None
- if response.status_code == 202:
- deserialized = self._deserialize("FileImport", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- _delete_initial.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
-
- @distributed_trace_async
- async def begin_delete(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
- ) -> AsyncLROPoller[_models.FileImport]:
- """Delete the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
- this operation to not poll, or pass in your own initialized polling object for a personal
- polling strategy.
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of AsyncLROPoller that returns either FileImport or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.FileImport]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
- polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
- if cont_token is None:
- raw_result = await self._delete_initial(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- api_version=api_version,
- cls=lambda x, y, z: x,
- headers=_headers,
- params=_params,
- **kwargs
- )
- kwargs.pop("error_map", None)
-
- def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("FileImport", pipeline_response)
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
-
- if polling is True:
- polling_method: AsyncPollingMethod = cast(
- AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
- )
- elif polling is False:
- polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
- else:
- polling_method = polling
- if cont_token:
- return AsyncLROPoller.from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
-
- begin_delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_operations.py
deleted file mode 100644
index 015f667e45a7..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_operations.py
+++ /dev/null
@@ -1,124 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, Optional, TypeVar
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._get_operations import build_single_recommendation_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class GetOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`get` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace_async
- async def single_recommendation(
- self, resource_group_name: str, workspace_name: str, recommendation_id: str, **kwargs: Any
- ) -> _models.Recommendation:
- """Gets a recommendation by its id.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Recommendation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Recommendation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
-
- request = build_single_recommendation_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- recommendation_id=recommendation_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.single_recommendation.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Recommendation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- single_recommendation.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_comments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_comments_operations.py
index 0a69a9384b3f..b686a6f530c0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_comments_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_comments_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._incident_comments_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,7 +73,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.IncidentComment"]:
- """Gets all incident comments.
+ """Gets all comments for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -96,7 +94,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IncidentComment or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.IncidentComment]
@@ -105,12 +102,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentCommentList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -121,7 +116,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -131,12 +126,10 @@ def prepare_request(next_link=None):
top=top,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -148,13 +141,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("IncidentCommentList", pipeline_response)
@@ -164,10 +156,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -179,15 +172,11 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
) -> _models.IncidentComment:
- """Gets an incident comment.
+ """Gets a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -198,12 +187,11 @@ async def get(
:type incident_id: str
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -214,27 +202,24 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentComment] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_comment_id=incident_comment_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -243,16 +228,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentComment", pipeline_response)
+ deserialized = self._deserialize("IncidentComment", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -266,7 +247,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.IncidentComment:
- """Creates or updates the incident comment.
+ """Creates or updates a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -282,7 +263,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
@@ -295,12 +275,12 @@ async def create_or_update(
workspace_name: str,
incident_id: str,
incident_comment_id: str,
- incident_comment: IO,
+ incident_comment: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.IncidentComment:
- """Creates or updates the incident comment.
+ """Creates or updates a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -312,11 +292,10 @@ async def create_or_update(
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
:param incident_comment: The incident comment. Required.
- :type incident_comment: IO
+ :type incident_comment: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
@@ -329,10 +308,10 @@ async def create_or_update(
workspace_name: str,
incident_id: str,
incident_comment_id: str,
- incident_comment: Union[_models.IncidentComment, IO],
+ incident_comment: Union[_models.IncidentComment, IO[bytes]],
**kwargs: Any
) -> _models.IncidentComment:
- """Creates or updates the incident comment.
+ """Creates or updates a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -343,17 +322,14 @@ async def create_or_update(
:type incident_id: str
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
- :param incident_comment: The incident comment. Is either a model type or a IO type. Required.
- :type incident_comment: ~azure.mgmt.securityinsight.models.IncidentComment or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param incident_comment: The incident comment. Is either a IncidentComment type or a IO[bytes]
+ type. Required.
+ :type incident_comment: ~azure.mgmt.securityinsight.models.IncidentComment or IO[bytes]
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -364,21 +340,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.IncidentComment] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(incident_comment, (IO, bytes)):
+ if isinstance(incident_comment, (IOBase, bytes)):
_content = incident_comment
else:
_json = self._serialize.body(incident_comment, "IncidentComment")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -388,15 +362,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -405,26 +378,18 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("IncidentComment", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("IncidentComment", pipeline_response)
+ deserialized = self._deserialize("IncidentComment", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
) -> None:
- """Delete the incident comment.
+ """Deletes a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -435,12 +400,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type incident_id: str
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -451,27 +415,24 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_comment_id=incident_comment_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -481,8 +442,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_relations_operations.py
index 3fa719c8adf6..dee555de12a8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_relations_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_relations_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._incident_relations_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,7 +73,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.Relation"]:
- """Gets all incident relations.
+ """Gets all relations for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -96,7 +94,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Relation or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Relation]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -104,12 +101,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -120,7 +115,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -130,12 +125,10 @@ def prepare_request(next_link=None):
top=top,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -147,13 +140,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("RelationList", pipeline_response)
@@ -163,10 +155,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -178,15 +171,11 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
) -> _models.Relation:
- """Gets an incident relation.
+ """Gets a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -197,12 +186,11 @@ async def get(
:type incident_id: str
:param relation_name: Relation Name. Required.
:type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -213,27 +201,24 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
relation_name=relation_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -242,16 +227,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Relation", pipeline_response)
+ deserialized = self._deserialize("Relation", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -265,7 +246,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.Relation:
- """Creates or updates the incident relation.
+ """Creates or updates a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -281,7 +262,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -294,12 +274,12 @@ async def create_or_update(
workspace_name: str,
incident_id: str,
relation_name: str,
- relation: IO,
+ relation: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.Relation:
- """Creates or updates the incident relation.
+ """Creates or updates a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -311,11 +291,10 @@ async def create_or_update(
:param relation_name: Relation Name. Required.
:type relation_name: str
:param relation: The relation model. Required.
- :type relation: IO
+ :type relation: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -328,10 +307,10 @@ async def create_or_update(
workspace_name: str,
incident_id: str,
relation_name: str,
- relation: Union[_models.Relation, IO],
+ relation: Union[_models.Relation, IO[bytes]],
**kwargs: Any
) -> _models.Relation:
- """Creates or updates the incident relation.
+ """Creates or updates a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -342,17 +321,13 @@ async def create_or_update(
:type incident_id: str
:param relation_name: Relation Name. Required.
:type relation_name: str
- :param relation: The relation model. Is either a model type or a IO type. Required.
- :type relation: ~azure.mgmt.securityinsight.models.Relation or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param relation: The relation model. Is either a Relation type or a IO[bytes] type. Required.
+ :type relation: ~azure.mgmt.securityinsight.models.Relation or IO[bytes]
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -363,21 +338,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(relation, (IO, bytes)):
+ if isinstance(relation, (IOBase, bytes)):
_content = relation
else:
_json = self._serialize.body(relation, "Relation")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -387,15 +360,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -404,26 +376,18 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Relation", pipeline_response)
+ deserialized = self._deserialize("Relation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
) -> None:
- """Delete the incident relation.
+ """Deletes a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -434,12 +398,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type incident_id: str
:param relation_name: Relation Name. Required.
:type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -450,27 +413,24 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
relation_name=relation_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -480,8 +440,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_tasks_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_tasks_operations.py
index 3ab32b7e4d51..d55e0e7893dc 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_tasks_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incident_tasks_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._incident_tasks_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -76,7 +74,6 @@ def list(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IncidentTask or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.IncidentTask]
@@ -85,12 +82,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentTaskList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -101,18 +96,16 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -124,13 +117,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("IncidentTaskList", pipeline_response)
@@ -140,10 +132,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -155,10 +148,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
@@ -174,12 +163,11 @@ async def get(
:type incident_id: str
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -190,27 +178,24 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentTask] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_task_id=incident_task_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -219,16 +204,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentTask", pipeline_response)
+ deserialized = self._deserialize("IncidentTask", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -258,7 +239,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
@@ -271,7 +251,7 @@ async def create_or_update(
workspace_name: str,
incident_id: str,
incident_task_id: str,
- incident_task: IO,
+ incident_task: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -288,11 +268,10 @@ async def create_or_update(
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
:param incident_task: The incident task. Required.
- :type incident_task: IO
+ :type incident_task: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
@@ -305,7 +284,7 @@ async def create_or_update(
workspace_name: str,
incident_id: str,
incident_task_id: str,
- incident_task: Union[_models.IncidentTask, IO],
+ incident_task: Union[_models.IncidentTask, IO[bytes]],
**kwargs: Any
) -> _models.IncidentTask:
"""Creates or updates the incident task.
@@ -319,17 +298,14 @@ async def create_or_update(
:type incident_id: str
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
- :param incident_task: The incident task. Is either a model type or a IO type. Required.
- :type incident_task: ~azure.mgmt.securityinsight.models.IncidentTask or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param incident_task: The incident task. Is either a IncidentTask type or a IO[bytes] type.
+ Required.
+ :type incident_task: ~azure.mgmt.securityinsight.models.IncidentTask or IO[bytes]
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -340,21 +316,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.IncidentTask] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(incident_task, (IO, bytes)):
+ if isinstance(incident_task, (IOBase, bytes)):
_content = incident_task
else:
_json = self._serialize.body(incident_task, "IncidentTask")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -364,15 +338,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -381,23 +354,15 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("IncidentTask", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("IncidentTask", pipeline_response)
+ deserialized = self._deserialize("IncidentTask", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
) -> None:
"""Delete the incident task.
@@ -411,12 +376,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type incident_id: str
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -427,27 +391,24 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_task_id=incident_task_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -457,8 +418,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incidents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incidents_operations.py
index a0452b513c88..44dbcb2bae65 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incidents_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_incidents_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,18 +20,15 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._incidents_operations import (
build_create_or_update_request,
- build_create_team_request,
build_delete_request,
build_get_request,
build_list_alerts_request,
@@ -44,12 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -83,7 +75,7 @@ async def run_playbook(
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> JSON:
+ ) -> None:
"""Triggers playbook on a specific incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -91,16 +83,16 @@ async def run_playbook(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param incident_identifier: Required.
+ :param incident_identifier: Incident ID. Required.
:type incident_identifier: str
- :param request_body: Default value is None.
+ :param request_body: Describes the request body for triggering a playbook on an incident.
+ Default value is None.
:type request_body: ~azure.mgmt.securityinsight.models.ManualTriggerRequestBody
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: JSON or the result of cls(response)
- :rtype: JSON
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -110,11 +102,11 @@ async def run_playbook(
resource_group_name: str,
workspace_name: str,
incident_identifier: str,
- request_body: Optional[IO] = None,
+ request_body: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> JSON:
+ ) -> None:
"""Triggers playbook on a specific incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -122,16 +114,16 @@ async def run_playbook(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param incident_identifier: Required.
+ :param incident_identifier: Incident ID. Required.
:type incident_identifier: str
- :param request_body: Default value is None.
- :type request_body: IO
+ :param request_body: Describes the request body for triggering a playbook on an incident.
+ Default value is None.
+ :type request_body: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: JSON or the result of cls(response)
- :rtype: JSON
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -141,9 +133,9 @@ async def run_playbook(
resource_group_name: str,
workspace_name: str,
incident_identifier: str,
- request_body: Optional[Union[_models.ManualTriggerRequestBody, IO]] = None,
+ request_body: Optional[Union[_models.ManualTriggerRequestBody, IO[bytes]]] = None,
**kwargs: Any
- ) -> JSON:
+ ) -> None:
"""Triggers playbook on a specific incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -151,19 +143,16 @@ async def run_playbook(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param incident_identifier: Required.
+ :param incident_identifier: Incident ID. Required.
:type incident_identifier: str
- :param request_body: Is either a model type or a IO type. Default value is None.
- :type request_body: ~azure.mgmt.securityinsight.models.ManualTriggerRequestBody or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: JSON or the result of cls(response)
- :rtype: JSON
+ :param request_body: Describes the request body for triggering a playbook on an incident. Is
+ either a ManualTriggerRequestBody type or a IO[bytes] type. Default value is None.
+ :type request_body: ~azure.mgmt.securityinsight.models.ManualTriggerRequestBody or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -174,16 +163,14 @@ async def run_playbook(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[JSON] = kwargs.pop("cls", None)
+ cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(request_body, (IO, bytes)):
+ if isinstance(request_body, (IOBase, bytes)):
_content = request_body
else:
if request_body is not None:
@@ -191,7 +178,7 @@ async def run_playbook(
else:
_json = None
- request = build_run_playbook_request(
+ _request = build_run_playbook_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_identifier=incident_identifier,
@@ -200,15 +187,14 @@ async def run_playbook(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.run_playbook.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -217,16 +203,8 @@ async def run_playbook(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("object", pipeline_response)
-
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- run_playbook.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def list(
@@ -258,7 +236,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Incident or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Incident]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -266,12 +243,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -282,7 +257,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -291,12 +266,10 @@ def prepare_request(next_link=None):
top=top,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -308,13 +281,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("IncidentList", pipeline_response)
@@ -324,10 +296,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -339,15 +312,11 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.Incident:
- """Gets an incident.
+ """Gets a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -356,12 +325,11 @@ async def get(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -372,26 +340,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Incident] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -400,16 +365,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Incident", pipeline_response)
+ deserialized = self._deserialize("Incident", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -422,7 +383,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.Incident:
- """Creates or updates the incident.
+ """Creates or updates an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -436,7 +397,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
@@ -448,12 +408,12 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
incident_id: str,
- incident: IO,
+ incident: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.Incident:
- """Creates or updates the incident.
+ """Creates or updates an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -463,11 +423,10 @@ async def create_or_update(
:param incident_id: Incident ID. Required.
:type incident_id: str
:param incident: The incident. Required.
- :type incident: IO
+ :type incident: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
@@ -479,10 +438,10 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
incident_id: str,
- incident: Union[_models.Incident, IO],
+ incident: Union[_models.Incident, IO[bytes]],
**kwargs: Any
) -> _models.Incident:
- """Creates or updates the incident.
+ """Creates or updates an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -491,17 +450,13 @@ async def create_or_update(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :param incident: The incident. Is either a model type or a IO type. Required.
- :type incident: ~azure.mgmt.securityinsight.models.Incident or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param incident: The incident. Is either a Incident type or a IO[bytes] type. Required.
+ :type incident: ~azure.mgmt.securityinsight.models.Incident or IO[bytes]
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -512,21 +467,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Incident] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(incident, (IO, bytes)):
+ if isinstance(incident, (IOBase, bytes)):
_content = incident
else:
_json = self._serialize.body(incident, "Incident")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -535,15 +488,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -552,26 +504,16 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("Incident", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Incident", pipeline_response)
+ deserialized = self._deserialize("Incident", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
- ) -> None:
- """Delete the incident.
+ async def delete(self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any) -> None:
+ """Deletes a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -580,12 +522,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -596,26 +537,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -625,172 +563,13 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
-
- @overload
- async def create_team(
- self,
- resource_group_name: str,
- workspace_name: str,
- incident_id: str,
- team_properties: _models.TeamInformation,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.TeamInformation:
- """Creates a Microsoft team to investigate the incident by sharing information and insights
- between participants.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param incident_id: Incident ID. Required.
- :type incident_id: str
- :param team_properties: Team properties. Required.
- :type team_properties: ~azure.mgmt.securityinsight.models.TeamInformation
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: TeamInformation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.TeamInformation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def create_team(
- self,
- resource_group_name: str,
- workspace_name: str,
- incident_id: str,
- team_properties: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.TeamInformation:
- """Creates a Microsoft team to investigate the incident by sharing information and insights
- between participants.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param incident_id: Incident ID. Required.
- :type incident_id: str
- :param team_properties: Team properties. Required.
- :type team_properties: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: TeamInformation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.TeamInformation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def create_team(
- self,
- resource_group_name: str,
- workspace_name: str,
- incident_id: str,
- team_properties: Union[_models.TeamInformation, IO],
- **kwargs: Any
- ) -> _models.TeamInformation:
- """Creates a Microsoft team to investigate the incident by sharing information and insights
- between participants.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param incident_id: Incident ID. Required.
- :type incident_id: str
- :param team_properties: Team properties. Is either a model type or a IO type. Required.
- :type team_properties: ~azure.mgmt.securityinsight.models.TeamInformation or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: TeamInformation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.TeamInformation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.TeamInformation] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(team_properties, (IO, bytes)):
- _content = team_properties
- else:
- _json = self._serialize.body(team_properties, "TeamInformation")
-
- request = build_create_team_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- incident_id=incident_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create_team.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("TeamInformation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- create_team.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def list_alerts(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.IncidentAlertList:
- """Gets all incident alerts.
+ """Gets all alerts for an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -799,12 +578,11 @@ async def list_alerts(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentAlertList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentAlertList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -815,26 +593,23 @@ async def list_alerts(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentAlertList] = kwargs.pop("cls", None)
- request = build_list_alerts_request(
+ _request = build_list_alerts_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_alerts.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -843,22 +618,18 @@ async def list_alerts(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentAlertList", pipeline_response)
+ deserialized = self._deserialize("IncidentAlertList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list_alerts.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts"
- }
+ return deserialized # type: ignore
@distributed_trace_async
async def list_bookmarks(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.IncidentBookmarkList:
- """Gets all incident bookmarks.
+ """Gets all bookmarks for an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -867,12 +638,11 @@ async def list_bookmarks(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentBookmarkList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentBookmarkList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -883,26 +653,23 @@ async def list_bookmarks(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentBookmarkList] = kwargs.pop("cls", None)
- request = build_list_bookmarks_request(
+ _request = build_list_bookmarks_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_bookmarks.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -911,22 +678,18 @@ async def list_bookmarks(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentBookmarkList", pipeline_response)
+ deserialized = self._deserialize("IncidentBookmarkList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list_bookmarks.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks"
- }
+ return deserialized # type: ignore
@distributed_trace_async
async def list_entities(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.IncidentEntitiesResponse:
- """Gets all incident related entities.
+ """Gets all entities for an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -935,12 +698,11 @@ async def list_entities(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentEntitiesResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentEntitiesResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -951,26 +713,23 @@ async def list_entities(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentEntitiesResponse] = kwargs.pop("cls", None)
- request = build_list_entities_request(
+ _request = build_list_entities_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_entities.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -979,13 +738,9 @@ async def list_entities(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentEntitiesResponse", pipeline_response)
+ deserialized = self._deserialize("IncidentEntitiesResponse", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list_entities.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_ip_geodata_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_ip_geodata_operations.py
deleted file mode 100644
index e1f7121e301e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_ip_geodata_operations.py
+++ /dev/null
@@ -1,119 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, Optional, TypeVar
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._ip_geodata_operations import build_get_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class IPGeodataOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`ip_geodata` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace_async
- async def get(self, resource_group_name: str, ip_address: str, **kwargs: Any) -> _models.EnrichmentIpGeodata:
- """Get geodata for a single IP address.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param ip_address: IP address (v4 or v6) to be enriched. Required.
- :type ip_address: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EnrichmentIpGeodata or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EnrichmentIpGeodata] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- subscription_id=self._config.subscription_id,
- ip_address=ip_address,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EnrichmentIpGeodata", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_metadata_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_metadata_operations.py
index f9d87e686bcd..a52172a466d8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_metadata_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_metadata_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._metadata_operations import (
build_create_request,
build_delete_request,
@@ -37,10 +35,10 @@
build_update_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,7 +90,6 @@ def list(
:param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
next page of results if there are any left. Default value is None.
:type skip: int
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either MetadataModel or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.MetadataModel]
@@ -101,12 +98,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MetadataList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -117,7 +112,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -126,12 +121,10 @@ def prepare_request(next_link=None):
top=top,
skip=skip,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -143,13 +136,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("MetadataList", pipeline_response)
@@ -159,10 +151,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -174,10 +167,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
@@ -191,12 +180,11 @@ async def get(
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -207,26 +195,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MetadataModel] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -235,21 +220,15 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("MetadataModel", pipeline_response)
+ deserialized = self._deserialize("MetadataModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
+ return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any) -> None:
"""Delete a Metadata.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -259,12 +238,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -275,26 +253,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -304,11 +279,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
async def create(
@@ -335,7 +306,6 @@ async def create(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -347,7 +317,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata: IO,
+ metadata: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -362,11 +332,10 @@ async def create(
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
:param metadata: Metadata resource. Required.
- :type metadata: IO
+ :type metadata: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -378,7 +347,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata: Union[_models.MetadataModel, IO],
+ metadata: Union[_models.MetadataModel, IO[bytes]],
**kwargs: Any
) -> _models.MetadataModel:
"""Create a Metadata.
@@ -390,17 +359,14 @@ async def create(
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :param metadata: Metadata resource. Is either a model type or a IO type. Required.
- :type metadata: ~azure.mgmt.securityinsight.models.MetadataModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param metadata: Metadata resource. Is either a MetadataModel type or a IO[bytes] type.
+ Required.
+ :type metadata: ~azure.mgmt.securityinsight.models.MetadataModel or IO[bytes]
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -411,21 +377,19 @@ async def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MetadataModel] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(metadata, (IO, bytes)):
+ if isinstance(metadata, (IOBase, bytes)):
_content = metadata
else:
_json = self._serialize.body(metadata, "MetadataModel")
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
@@ -434,15 +398,14 @@ async def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -451,21 +414,13 @@ async def create(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("MetadataModel", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("MetadataModel", pipeline_response)
+ deserialized = self._deserialize("MetadataModel", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
-
@overload
async def update(
self,
@@ -491,7 +446,6 @@ async def update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -503,7 +457,7 @@ async def update(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata_patch: IO,
+ metadata_patch: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -518,11 +472,10 @@ async def update(
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
:param metadata_patch: Partial metadata request. Required.
- :type metadata_patch: IO
+ :type metadata_patch: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -534,7 +487,7 @@ async def update(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata_patch: Union[_models.MetadataPatch, IO],
+ metadata_patch: Union[_models.MetadataPatch, IO[bytes]],
**kwargs: Any
) -> _models.MetadataModel:
"""Update an existing Metadata.
@@ -546,17 +499,14 @@ async def update(
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :param metadata_patch: Partial metadata request. Is either a model type or a IO type. Required.
- :type metadata_patch: ~azure.mgmt.securityinsight.models.MetadataPatch or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param metadata_patch: Partial metadata request. Is either a MetadataPatch type or a IO[bytes]
+ type. Required.
+ :type metadata_patch: ~azure.mgmt.securityinsight.models.MetadataPatch or IO[bytes]
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -567,21 +517,19 @@ async def update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MetadataModel] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(metadata_patch, (IO, bytes)):
+ if isinstance(metadata_patch, (IOBase, bytes)):
_content = metadata_patch
else:
_json = self._serialize.body(metadata_patch, "MetadataPatch")
- request = build_update_request(
+ _request = build_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
@@ -590,15 +538,14 @@ async def update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -607,13 +554,9 @@ async def update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("MetadataModel", pipeline_response)
+ deserialized = self._deserialize("MetadataModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_office_consents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_office_consents_operations.py
deleted file mode 100644
index fffada186187..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_office_consents_operations.py
+++ /dev/null
@@ -1,284 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
-import urllib.parse
-
-from azure.core.async_paging import AsyncItemPaged, AsyncList
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._office_consents_operations import build_delete_request, build_get_request, build_list_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class OfficeConsentsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`office_consents` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def list(
- self, resource_group_name: str, workspace_name: str, **kwargs: Any
- ) -> AsyncIterable["_models.OfficeConsent"]:
- """Gets all office365 consents.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either OfficeConsent or the result of cls(response)
- :rtype:
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.OfficeConsent]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.OfficeConsentList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- async def extract_data(pipeline_response):
- deserialized = self._deserialize("OfficeConsentList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, AsyncList(list_of_elem)
-
- async def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents"
- }
-
- @distributed_trace_async
- async def get(
- self, resource_group_name: str, workspace_name: str, consent_id: str, **kwargs: Any
- ) -> _models.OfficeConsent:
- """Gets an office365 consent.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param consent_id: consent ID. Required.
- :type consent_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: OfficeConsent or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.OfficeConsent
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.OfficeConsent] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- consent_id=consent_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("OfficeConsent", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}"
- }
-
- @distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, consent_id: str, **kwargs: Any
- ) -> None:
- """Delete the office365 consent.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param consent_id: consent ID. Required.
- :type consent_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- consent_id=consent_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.delete.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_operations.py
index 376f9dc326f2..43634d255d33 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,20 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._operations import build_list_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -61,7 +58,6 @@ def __init__(self, *args, **kwargs) -> None:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
"""Lists all operations available Azure Security Insights Resource Provider.
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -69,12 +65,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -85,14 +79,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -104,13 +96,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("OperationsList", pipeline_response)
@@ -120,10 +111,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -134,5 +126,3 @@ async def get_next(next_link=None):
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {"url": "/providers/Microsoft.SecurityInsights/operations"}
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_recommendations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_package_operations.py
similarity index 63%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_recommendations_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_package_operations.py
index e46e68a6f58a..c18bc219ed80 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_recommendations_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_package_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -18,32 +17,30 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._get_recommendations_operations import build_list_request
+from ...operations._product_package_operations import build_get_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class GetRecommendationsOperations:
+class ProductPackageOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`get_recommendations` attribute.
+ :attr:`product_package` attribute.
"""
models = _models
@@ -56,20 +53,23 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.RecommendationList:
- """Gets a list of all recommendations.
+ async def get(
+ self, resource_group_name: str, workspace_name: str, package_id: str, **kwargs: Any
+ ) -> _models.ProductPackageModel:
+ """Gets a package by its identifier from the catalog.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: RecommendationList or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.RecommendationList
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :return: ProductPackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ProductPackageModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -80,25 +80,23 @@ async def list(self, resource_group_name: str, workspace_name: str, **kwargs: An
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.RecommendationList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductPackageModel] = kwargs.pop("cls", None)
- request = build_list_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
+ package_id=package_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -107,13 +105,9 @@ async def list(self, resource_group_name: str, workspace_name: str, **kwargs: An
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("RecommendationList", pipeline_response)
+ deserialized = self._deserialize("ProductPackageModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_packages_operations.py
similarity index 71%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_relations_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_packages_operations.py
index d232b818621f..f2a7b3e28a7a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_entities_relations_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_packages_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,32 +19,30 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._entities_relations_operations import build_list_request
+from ...operations._product_packages_operations import build_list_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class EntitiesRelationsOperations:
+class ProductPackagesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`entities_relations` attribute.
+ :attr:`product_packages` attribute.
"""
models = _models
@@ -62,22 +59,25 @@ def list(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
filter: Optional[str] = None,
orderby: Optional[str] = None,
top: Optional[int] = None,
skip_token: Optional[str] = None,
+ search: Optional[str] = None,
**kwargs: Any
- ) -> AsyncIterable["_models.Relation"]:
- """Gets all relations of an entity.
+ ) -> AsyncIterable["_models.ProductPackageModel"]:
+ """Gets all packages from the catalog.
+ Expandable properties:
+
+
+ * properties/installed
+ * properties/packagedContent.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
:param filter: Filters the results, based on a Boolean condition. Optional. Default value is
None.
:type filter: str
@@ -90,20 +90,20 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either Relation or the result of cls(response)
- :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Relation]
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :return: An iterator like instance of either ProductPackageModel or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.ProductPackageModel]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductPackageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -114,22 +114,20 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_id=entity_id,
subscription_id=self._config.subscription_id,
filter=filter,
orderby=orderby,
top=top,
skip_token=skip_token,
+ search=search,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -141,26 +139,26 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
- deserialized = self._deserialize("RelationList", pipeline_response)
+ deserialized = self._deserialize("ProductPackageList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -171,7 +169,3 @@ async def get_next(next_link=None):
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py
deleted file mode 100644
index 3324a16bab68..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py
+++ /dev/null
@@ -1,413 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._product_settings_operations import (
- build_delete_request,
- build_get_request,
- build_list_request,
- build_update_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class ProductSettingsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`product_settings` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace_async
- async def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.SettingList:
- """List of all the settings.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SettingList or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SettingList
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.SettingList] = kwargs.pop("cls", None)
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("SettingList", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings"
- }
-
- @distributed_trace_async
- async def get(
- self, resource_group_name: str, workspace_name: str, settings_name: str, **kwargs: Any
- ) -> _models.Settings:
- """Gets a setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Settings] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- settings_name=settings_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Settings", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
-
- @distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, settings_name: str, **kwargs: Any
- ) -> None:
- """Delete setting of the product.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- settings_name=settings_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.delete.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
-
- @overload
- async def update(
- self,
- resource_group_name: str,
- workspace_name: str,
- settings_name: str,
- settings: _models.Settings,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Settings:
- """Updates setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :param settings: The setting. Required.
- :type settings: ~azure.mgmt.securityinsight.models.Settings
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def update(
- self,
- resource_group_name: str,
- workspace_name: str,
- settings_name: str,
- settings: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Settings:
- """Updates setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :param settings: The setting. Required.
- :type settings: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def update(
- self,
- resource_group_name: str,
- workspace_name: str,
- settings_name: str,
- settings: Union[_models.Settings, IO],
- **kwargs: Any
- ) -> _models.Settings:
- """Updates setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :param settings: The setting. Is either a model type or a IO type. Required.
- :type settings: ~azure.mgmt.securityinsight.models.Settings or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Settings] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(settings, (IO, bytes)):
- _content = settings
- else:
- _json = self._serialize.body(settings, "Settings")
-
- request = build_update_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- settings_name=settings_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.update.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Settings", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_domain_whois_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_template_operations.py
similarity index 61%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_domain_whois_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_template_operations.py
index 30b1d059703f..4e41ada78114 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_domain_whois_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_template_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -18,32 +17,30 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._domain_whois_operations import build_get_request
+from ...operations._product_template_operations import build_get_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class DomainWhoisOperations:
+class ProductTemplateOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`domain_whois` attribute.
+ :attr:`product_template` attribute.
"""
models = _models
@@ -56,20 +53,23 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def get(self, resource_group_name: str, domain: str, **kwargs: Any) -> _models.EnrichmentDomainWhois:
- """Get whois information for a single domain name.
+ async def get(
+ self, resource_group_name: str, workspace_name: str, template_id: str, **kwargs: Any
+ ) -> _models.ProductTemplateModel:
+ """Gets a template by its identifier.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param domain: Domain name to be enriched. Required.
- :type domain: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EnrichmentDomainWhois or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :return: ProductTemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ProductTemplateModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -80,25 +80,23 @@ async def get(self, resource_group_name: str, domain: str, **kwargs: Any) -> _mo
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EnrichmentDomainWhois] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductTemplateModel] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ template_id=template_id,
subscription_id=self._config.subscription_id,
- domain=domain,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -107,13 +105,9 @@ async def get(self, resource_group_name: str, domain: str, **kwargs: Any) -> _mo
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EnrichmentDomainWhois", pipeline_response)
+ deserialized = self._deserialize("ProductTemplateModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_templates_operations.py
new file mode 100644
index 000000000000..aa902f669f77
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_templates_operations.py
@@ -0,0 +1,177 @@
+# 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 sys
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._product_templates_operations import build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class ProductTemplatesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`product_templates` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.ProductTemplateModel"]:
+ """Gets all templates in the catalog.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: str
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :param count: Instructs the server to return only object count without actual body. Optional.
+ Default value is None.
+ :type count: bool
+ :param top: Returns only the first n results. Optional. Default value is None.
+ :type top: int
+ :param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
+ next page of results if there are any left. Default value is None.
+ :type skip: int
+ :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
+ a previous response contains a nextLink element, the value of the nextLink element will include
+ a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
+ Default value is None.
+ :type skip_token: str
+ :return: An iterator like instance of either ProductTemplateModel or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.ProductTemplateModel]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductTemplateList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ search=search,
+ count=count,
+ top=top,
+ skip=skip,
+ skip_token=skip_token,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ProductTemplateList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_ml_analytics_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_ml_analytics_settings_operations.py
index eb537fb84c40..3ff924cd29f2 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_ml_analytics_settings_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_ml_analytics_settings_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._security_ml_analytics_settings_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -74,7 +72,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SecurityMLAnalyticsSetting or the result of
cls(response)
:rtype:
@@ -84,12 +81,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SecurityMLAnalyticsSettingsList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -100,17 +95,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -122,13 +115,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("SecurityMLAnalyticsSettingsList", pipeline_response)
@@ -138,10 +130,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -153,10 +146,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
@@ -170,12 +159,11 @@ async def get(
:type workspace_name: str
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -186,26 +174,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SecurityMLAnalyticsSetting] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_resource_name=settings_resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -214,16 +199,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response)
+ deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
+ return deserialized # type: ignore
@overload
async def create_or_update(
@@ -251,7 +232,6 @@ async def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
@@ -263,7 +243,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
settings_resource_name: str,
- security_ml_analytics_setting: IO,
+ security_ml_analytics_setting: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -278,11 +258,10 @@ async def create_or_update(
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
:param security_ml_analytics_setting: The security ML Analytics setting. Required.
- :type security_ml_analytics_setting: IO
+ :type security_ml_analytics_setting: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
@@ -294,7 +273,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
settings_resource_name: str,
- security_ml_analytics_setting: Union[_models.SecurityMLAnalyticsSetting, IO],
+ security_ml_analytics_setting: Union[_models.SecurityMLAnalyticsSetting, IO[bytes]],
**kwargs: Any
) -> _models.SecurityMLAnalyticsSetting:
"""Creates or updates the Security ML Analytics Settings.
@@ -306,19 +285,15 @@ async def create_or_update(
:type workspace_name: str
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
- :param security_ml_analytics_setting: The security ML Analytics setting. Is either a model type
- or a IO type. Required.
+ :param security_ml_analytics_setting: The security ML Analytics setting. Is either a
+ SecurityMLAnalyticsSetting type or a IO[bytes] type. Required.
:type security_ml_analytics_setting:
- ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting or IO[bytes]
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -329,21 +304,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SecurityMLAnalyticsSetting] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(security_ml_analytics_setting, (IO, bytes)):
+ if isinstance(security_ml_analytics_setting, (IOBase, bytes)):
_content = security_ml_analytics_setting
else:
_json = self._serialize.body(security_ml_analytics_setting, "SecurityMLAnalyticsSetting")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_resource_name=settings_resource_name,
@@ -352,15 +325,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -369,23 +341,15 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response)
+ deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
) -> None:
"""Delete the Security ML Analytics Settings.
@@ -397,12 +361,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -413,26 +376,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_resource_name=settings_resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -442,8 +402,4 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_sentinel_onboarding_states_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_sentinel_onboarding_states_operations.py
index aac64f7fdd94..209929ec2c64 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_sentinel_onboarding_states_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_sentinel_onboarding_states_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
@@ -18,14 +18,12 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._sentinel_onboarding_states_operations import (
build_create_request,
build_delete_request,
@@ -33,10 +31,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -74,12 +72,11 @@ async def get(
:param sentinel_onboarding_state_name: The Sentinel onboarding state name. Supports - default.
Required.
:type sentinel_onboarding_state_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -90,26 +87,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SentinelOnboardingState] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
sentinel_onboarding_state_name=sentinel_onboarding_state_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -118,16 +112,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SentinelOnboardingState", pipeline_response)
+ deserialized = self._deserialize("SentinelOnboardingState", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
+ return deserialized # type: ignore
@overload
async def create(
@@ -157,7 +147,6 @@ async def create(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
@@ -169,7 +158,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
sentinel_onboarding_state_name: str,
- sentinel_onboarding_state_parameter: Optional[IO] = None,
+ sentinel_onboarding_state_parameter: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
@@ -186,11 +175,10 @@ async def create(
:type sentinel_onboarding_state_name: str
:param sentinel_onboarding_state_parameter: The Sentinel onboarding state parameter. Default
value is None.
- :type sentinel_onboarding_state_parameter: IO
+ :type sentinel_onboarding_state_parameter: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
@@ -202,7 +190,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
sentinel_onboarding_state_name: str,
- sentinel_onboarding_state_parameter: Optional[Union[_models.SentinelOnboardingState, IO]] = None,
+ sentinel_onboarding_state_parameter: Optional[Union[_models.SentinelOnboardingState, IO[bytes]]] = None,
**kwargs: Any
) -> _models.SentinelOnboardingState:
"""Create Sentinel onboarding state.
@@ -216,18 +204,14 @@ async def create(
Required.
:type sentinel_onboarding_state_name: str
:param sentinel_onboarding_state_parameter: The Sentinel onboarding state parameter. Is either
- a model type or a IO type. Default value is None.
+ a SentinelOnboardingState type or a IO[bytes] type. Default value is None.
:type sentinel_onboarding_state_parameter:
- ~azure.mgmt.securityinsight.models.SentinelOnboardingState or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.SentinelOnboardingState or IO[bytes]
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -238,16 +222,14 @@ async def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SentinelOnboardingState] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(sentinel_onboarding_state_parameter, (IO, bytes)):
+ if isinstance(sentinel_onboarding_state_parameter, (IOBase, bytes)):
_content = sentinel_onboarding_state_parameter
else:
if sentinel_onboarding_state_parameter is not None:
@@ -255,7 +237,7 @@ async def create(
else:
_json = None
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
sentinel_onboarding_state_name=sentinel_onboarding_state_name,
@@ -264,15 +246,14 @@ async def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -281,23 +262,15 @@ async def create(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("SentinelOnboardingState", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("SentinelOnboardingState", pipeline_response)
+ deserialized = self._deserialize("SentinelOnboardingState", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, sentinel_onboarding_state_name: str, **kwargs: Any
) -> None:
"""Delete Sentinel onboarding state.
@@ -310,12 +283,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:param sentinel_onboarding_state_name: The Sentinel onboarding state name. Supports - default.
Required.
:type sentinel_onboarding_state_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -326,26 +298,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
sentinel_onboarding_state_name=sentinel_onboarding_state_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -355,11 +324,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def list(
@@ -372,12 +337,11 @@ async def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingStatesList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingStatesList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -388,25 +352,22 @@ async def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SentinelOnboardingStatesList] = kwargs.pop("cls", None)
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -415,13 +376,9 @@ async def list(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SentinelOnboardingStatesList", pipeline_response)
+ deserialized = self._deserialize("SentinelOnboardingStatesList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_control_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_control_operations.py
index 121de431e0c8..756b212987ca 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_control_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_control_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,8 +5,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -20,20 +20,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._source_control_operations import build_list_repositories_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -57,9 +55,67 @@ def __init__(self, *args, **kwargs) -> None:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+ @overload
+ def list_repositories(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ repository_access: _models.RepositoryAccessProperties,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Repo"]:
+ """Gets a list of repositories metadata.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An iterator like instance of either Repo or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Repo]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def list_repositories(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ repository_access: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Repo"]:
+ """Gets a list of repositories metadata.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An iterator like instance of either Repo or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Repo]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
@distributed_trace
def list_repositories(
- self, resource_group_name: str, workspace_name: str, repo_type: Union[str, _models.RepoType], **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ repository_access: Union[_models.RepositoryAccessProperties, IO[bytes]],
+ **kwargs: Any
) -> AsyncIterable["_models.Repo"]:
"""Gets a list of repositories metadata.
@@ -68,9 +124,10 @@ def list_repositories(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param repo_type: The repo type. Known values are: "Github" and "DevOps". Required.
- :type repo_type: str or ~azure.mgmt.securityinsight.models.RepoType
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param repository_access: The repository access credentials. Is either a
+ RepositoryAccessProperties type or a IO[bytes] type. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties or
+ IO[bytes]
:return: An iterator like instance of either Repo or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Repo]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -78,37 +135,40 @@ def list_repositories(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.RepoList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(repository_access, (IOBase, bytes)):
+ _content = repository_access
+ else:
+ _json = self._serialize.body(repository_access, "RepositoryAccessProperties")
def prepare_request(next_link=None):
if not next_link:
- _json = self._serialize.body(repo_type, "str")
- request = build_list_repositories_request(
+ _request = build_list_repositories_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
- template_url=self.list_repositories.metadata["url"],
+ content=_content,
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -120,13 +180,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("RepoList", pipeline_response)
@@ -136,10 +195,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -150,7 +210,3 @@ async def get_next(next_link=None):
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
-
- list_repositories.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_controls_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_controls_operations.py
index a2a445e2e5e2..feb8cbe3f113 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_controls_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_source_controls_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._source_controls_operations import (
build_create_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -74,7 +72,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SourceControl or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.SourceControl]
@@ -83,12 +80,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SourceControlList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -99,17 +94,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -121,13 +114,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("SourceControlList", pipeline_response)
@@ -137,10 +129,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -152,10 +145,6 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, source_control_id: str, **kwargs: Any
@@ -169,12 +158,11 @@ async def get(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SourceControl or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SourceControl
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -185,26 +173,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
source_control_id=source_control_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -213,22 +198,83 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SourceControl", pipeline_response)
+ deserialized = self._deserialize("SourceControl", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- return deserialized
+ return deserialized # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
+ @overload
+ async def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ source_control: _models.SourceControl,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SourceControl:
+ """Creates a source control.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param source_control_id: Source control Id. Required.
+ :type source_control_id: str
+ :param source_control: The SourceControl. Required.
+ :type source_control: ~azure.mgmt.securityinsight.models.SourceControl
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SourceControl or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ source_control: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SourceControl:
+ """Creates a source control.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param source_control_id: Source control Id. Required.
+ :type source_control_id: str
+ :param source_control: The SourceControl. Required.
+ :type source_control: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SourceControl or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, source_control_id: str, **kwargs: Any
- ) -> None:
- """Delete a source control.
+ async def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ source_control: Union[_models.SourceControl, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.SourceControl:
+ """Creates a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -237,12 +283,14 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
+ :param source_control: The SourceControl. Is either a SourceControl type or a IO[bytes] type.
+ Required.
+ :type source_control: ~azure.mgmt.securityinsight.models.SourceControl or IO[bytes]
+ :return: SourceControl or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SourceControl
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -250,56 +298,65 @@ async def delete( # pylint: disable=inconsistent-return-statements
}
error_map.update(kwargs.pop("error_map", {}) or {})
- _headers = kwargs.pop("headers", {}) or {}
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(source_control, (IOBase, bytes)):
+ _content = source_control
+ else:
+ _json = self._serialize.body(source_control, "SourceControl")
- request = build_delete_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
source_control_id=source_control_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
+ content_type=content_type,
+ json=_json,
+ content=_content,
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200, 204]:
+ if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = self._deserialize("SourceControl", pipeline_response.http_response)
+
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
+ return deserialized # type: ignore
@overload
- async def create(
+ async def delete(
self,
resource_group_name: str,
workspace_name: str,
source_control_id: str,
- source_control: _models.SourceControl,
+ repository_access: _models.RepositoryAccessProperties,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.SourceControl:
- """Creates a source control.
+ ) -> _models.Warning:
+ """Delete a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -308,29 +365,28 @@ async def create(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :param source_control: The SourceControl. Required.
- :type source_control: ~azure.mgmt.securityinsight.models.SourceControl
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SourceControl or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :return: Warning or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Warning
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- async def create(
+ async def delete(
self,
resource_group_name: str,
workspace_name: str,
source_control_id: str,
- source_control: IO,
+ repository_access: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.SourceControl:
- """Creates a source control.
+ ) -> _models.Warning:
+ """Delete a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -339,27 +395,26 @@ async def create(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :param source_control: The SourceControl. Required.
- :type source_control: IO
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SourceControl or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :return: Warning or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Warning
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
- async def create(
+ async def delete(
self,
resource_group_name: str,
workspace_name: str,
source_control_id: str,
- source_control: Union[_models.SourceControl, IO],
+ repository_access: Union[_models.RepositoryAccessProperties, IO[bytes]],
**kwargs: Any
- ) -> _models.SourceControl:
- """Creates a source control.
+ ) -> _models.Warning:
+ """Delete a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -368,17 +423,15 @@ async def create(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :param source_control: The SourceControl. Is either a model type or a IO type. Required.
- :type source_control: ~azure.mgmt.securityinsight.models.SourceControl or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SourceControl or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :param repository_access: The repository access credentials. Is either a
+ RepositoryAccessProperties type or a IO[bytes] type. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties or
+ IO[bytes]
+ :return: Warning or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Warning
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -389,21 +442,19 @@ async def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None)
+ cls: ClsType[_models.Warning] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(source_control, (IO, bytes)):
- _content = source_control
+ if isinstance(repository_access, (IOBase, bytes)):
+ _content = repository_access
else:
- _json = self._serialize.body(source_control, "SourceControl")
+ _json = self._serialize.body(repository_access, "RepositoryAccessProperties")
- request = build_create_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
source_control_id=source_control_id,
@@ -412,34 +463,25 @@ async def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200, 201]:
+ if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("SourceControl", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("SourceControl", pipeline_response)
+ deserialized = self._deserialize("Warning", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
-
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_metrics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_metrics_operations.py
index 5847ff70bdcb..36509c61fa5e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_metrics_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_metrics_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -18,25 +17,23 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._threat_intelligence_indicator_metrics_operations import build_list_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class ThreatIntelligenceIndicatorMetricsOperations:
+class ThreatIntelligenceIndicatorMetricsOperations: # pylint: disable=name-too-long
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -66,12 +63,11 @@ async def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceMetricsList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -82,25 +78,22 @@ async def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ThreatIntelligenceMetricsList] = kwargs.pop("cls", None)
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -109,13 +102,9 @@ async def list(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ThreatIntelligenceMetricsList", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceMetricsList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_operations.py
index e33a32402aa2..eeea4d978179 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicator_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._threat_intelligence_indicator_operations import (
build_append_tags_request,
build_create_indicator_request,
@@ -39,10 +37,10 @@
build_replace_tags_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -90,7 +88,6 @@ async def create_indicator(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -101,7 +98,7 @@ async def create_indicator(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_properties: IO,
+ threat_intelligence_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -115,11 +112,10 @@ async def create_indicator(
:type workspace_name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
and update. Required.
- :type threat_intelligence_properties: IO
+ :type threat_intelligence_properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -130,7 +126,7 @@ async def create_indicator(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO],
+ threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO[bytes]],
**kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""Create a new threat intelligence indicator.
@@ -141,18 +137,14 @@ async def create_indicator(
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
- and update. Is either a model type or a IO type. Required.
+ and update. Is either a ThreatIntelligenceIndicatorModel type or a IO[bytes] type. Required.
:type threat_intelligence_properties:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO[bytes]
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -163,21 +155,19 @@ async def create_indicator(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_properties, (IO, bytes)):
+ if isinstance(threat_intelligence_properties, (IOBase, bytes)):
_content = threat_intelligence_properties
else:
_json = self._serialize.body(threat_intelligence_properties, "ThreatIntelligenceIndicatorModel")
- request = build_create_indicator_request(
+ _request = build_create_indicator_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -185,15 +175,14 @@ async def create_indicator(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_indicator.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -202,21 +191,13 @@ async def create_indicator(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_indicator.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any
@@ -230,12 +211,11 @@ async def get(
:type workspace_name: str
:param name: Threat intelligence indicator name field. Required.
:type name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -246,26 +226,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -274,16 +251,12 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
+ return deserialized # type: ignore
@overload
async def create(
@@ -312,7 +285,6 @@ async def create(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -324,7 +296,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_properties: IO,
+ threat_intelligence_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -340,11 +312,10 @@ async def create(
:type name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
and update. Required.
- :type threat_intelligence_properties: IO
+ :type threat_intelligence_properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -356,7 +327,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO],
+ threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO[bytes]],
**kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""Update a threat Intelligence indicator.
@@ -369,18 +340,14 @@ async def create(
:param name: Threat intelligence indicator name field. Required.
:type name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
- and update. Is either a model type or a IO type. Required.
+ and update. Is either a ThreatIntelligenceIndicatorModel type or a IO[bytes] type. Required.
:type threat_intelligence_properties:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO[bytes]
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -391,21 +358,19 @@ async def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_properties, (IO, bytes)):
+ if isinstance(threat_intelligence_properties, (IOBase, bytes)):
_content = threat_intelligence_properties
else:
_json = self._serialize.body(threat_intelligence_properties, "ThreatIntelligenceIndicatorModel")
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
@@ -414,15 +379,14 @@ async def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -431,25 +395,15 @@ async def create(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
-
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> None:
"""Delete a threat intelligence indicator.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -459,12 +413,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param name: Threat intelligence indicator name field. Required.
:type name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -475,26 +428,23 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -504,11 +454,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
def query_indicators(
@@ -534,7 +480,6 @@ def query_indicators(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -547,7 +492,7 @@ def query_indicators(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_filtering_criteria: IO,
+ threat_intelligence_filtering_criteria: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -561,11 +506,10 @@ def query_indicators(
:type workspace_name: str
:param threat_intelligence_filtering_criteria: Filtering criteria for querying threat
intelligence indicators. Required.
- :type threat_intelligence_filtering_criteria: IO
+ :type threat_intelligence_filtering_criteria: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -578,7 +522,7 @@ def query_indicators(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_filtering_criteria: Union[_models.ThreatIntelligenceFilteringCriteria, IO],
+ threat_intelligence_filtering_criteria: Union[_models.ThreatIntelligenceFilteringCriteria, IO[bytes]],
**kwargs: Any
) -> AsyncIterable["_models.ThreatIntelligenceInformation"]:
"""Query threat intelligence indicators as per filtering criteria.
@@ -589,13 +533,10 @@ def query_indicators(
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param threat_intelligence_filtering_criteria: Filtering criteria for querying threat
- intelligence indicators. Is either a model type or a IO type. Required.
+ intelligence indicators. Is either a ThreatIntelligenceFilteringCriteria type or a IO[bytes]
+ type. Required.
:type threat_intelligence_filtering_criteria:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceFilteringCriteria or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceFilteringCriteria or IO[bytes]
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -605,13 +546,11 @@ def query_indicators(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -621,7 +560,7 @@ def query_indicators(
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_filtering_criteria, (IO, bytes)):
+ if isinstance(threat_intelligence_filtering_criteria, (IOBase, bytes)):
_content = threat_intelligence_filtering_criteria
else:
_json = self._serialize.body(threat_intelligence_filtering_criteria, "ThreatIntelligenceFilteringCriteria")
@@ -629,7 +568,7 @@ def query_indicators(
def prepare_request(next_link=None):
if not next_link:
- request = build_query_indicators_request(
+ _request = build_query_indicators_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -637,12 +576,10 @@ def prepare_request(next_link=None):
content_type=content_type,
json=_json,
content=_content,
- template_url=self.query_indicators.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -654,13 +591,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ThreatIntelligenceInformationList", pipeline_response)
@@ -670,10 +606,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -685,12 +622,8 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- query_indicators.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators"
- }
-
@overload
- async def append_tags( # pylint: disable=inconsistent-return-statements
+ async def append_tags(
self,
resource_group_name: str,
workspace_name: str,
@@ -716,19 +649,18 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- async def append_tags( # pylint: disable=inconsistent-return-statements
+ async def append_tags(
self,
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_append_tags: IO,
+ threat_intelligence_append_tags: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -744,23 +676,22 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
:type name: str
:param threat_intelligence_append_tags: The threat intelligence append tags request body.
Required.
- :type threat_intelligence_append_tags: IO
+ :type threat_intelligence_append_tags: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
- async def append_tags( # pylint: disable=inconsistent-return-statements
+ async def append_tags(
self,
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_append_tags: Union[_models.ThreatIntelligenceAppendTags, IO],
+ threat_intelligence_append_tags: Union[_models.ThreatIntelligenceAppendTags, IO[bytes]],
**kwargs: Any
) -> None:
"""Append tags to a threat intelligence indicator.
@@ -773,18 +704,14 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
:param name: Threat intelligence indicator name field. Required.
:type name: str
:param threat_intelligence_append_tags: The threat intelligence append tags request body. Is
- either a model type or a IO type. Required.
+ either a ThreatIntelligenceAppendTags type or a IO[bytes] type. Required.
:type threat_intelligence_append_tags:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceAppendTags or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceAppendTags or IO[bytes]
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -795,21 +722,19 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_append_tags, (IO, bytes)):
+ if isinstance(threat_intelligence_append_tags, (IOBase, bytes)):
_content = threat_intelligence_append_tags
else:
_json = self._serialize.body(threat_intelligence_append_tags, "ThreatIntelligenceAppendTags")
- request = build_append_tags_request(
+ _request = build_append_tags_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
@@ -818,15 +743,14 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
content_type=content_type,
json=_json,
content=_content,
- template_url=self.append_tags.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -836,11 +760,7 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- append_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
async def replace_tags(
@@ -869,7 +789,6 @@ async def replace_tags(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -881,7 +800,7 @@ async def replace_tags(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_replace_tags: IO,
+ threat_intelligence_replace_tags: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -897,11 +816,10 @@ async def replace_tags(
:type name: str
:param threat_intelligence_replace_tags: Tags in the threat intelligence indicator to be
replaced. Required.
- :type threat_intelligence_replace_tags: IO
+ :type threat_intelligence_replace_tags: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -913,7 +831,7 @@ async def replace_tags(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_replace_tags: Union[_models.ThreatIntelligenceIndicatorModel, IO],
+ threat_intelligence_replace_tags: Union[_models.ThreatIntelligenceIndicatorModel, IO[bytes]],
**kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""Replace tags added to a threat intelligence indicator.
@@ -926,18 +844,14 @@ async def replace_tags(
:param name: Threat intelligence indicator name field. Required.
:type name: str
:param threat_intelligence_replace_tags: Tags in the threat intelligence indicator to be
- replaced. Is either a model type or a IO type. Required.
+ replaced. Is either a ThreatIntelligenceIndicatorModel type or a IO[bytes] type. Required.
:type threat_intelligence_replace_tags:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO[bytes]
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -948,21 +862,19 @@ async def replace_tags(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_replace_tags, (IO, bytes)):
+ if isinstance(threat_intelligence_replace_tags, (IOBase, bytes)):
_content = threat_intelligence_replace_tags
else:
_json = self._serialize.body(threat_intelligence_replace_tags, "ThreatIntelligenceIndicatorModel")
- request = build_replace_tags_request(
+ _request = build_replace_tags_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
@@ -971,15 +883,14 @@ async def replace_tags(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.replace_tags.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -988,13 +899,9 @@ async def replace_tags(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- replace_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicators_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicators_operations.py
index 43499935ceb1..04f0b9d6de0a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicators_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_indicators_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,20 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._threat_intelligence_indicators_operations import build_list_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -63,9 +60,9 @@ def list(
resource_group_name: str,
workspace_name: str,
filter: Optional[str] = None,
- orderby: Optional[str] = None,
top: Optional[int] = None,
skip_token: Optional[str] = None,
+ orderby: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.ThreatIntelligenceInformation"]:
"""Get all threat intelligence indicators.
@@ -78,8 +75,6 @@ def list(
:param filter: Filters the results, based on a Boolean condition. Optional. Default value is
None.
:type filter: str
- :param orderby: Sorts the results. Optional. Default value is None.
- :type orderby: str
:param top: Returns only the first n results. Optional. Default value is None.
:type top: int
:param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
@@ -87,7 +82,8 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -97,12 +93,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -113,21 +107,19 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
filter=filter,
- orderby=orderby,
top=top,
skip_token=skip_token,
+ orderby=orderby,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -139,13 +131,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ThreatIntelligenceInformationList", pipeline_response)
@@ -155,10 +146,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -169,7 +161,3 @@ async def get_next(next_link=None):
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_update_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_update_operations.py
deleted file mode 100644
index 18154771938c..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_update_operations.py
+++ /dev/null
@@ -1,294 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator_async import distributed_trace_async
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
-
-from ... import models as _models
-from ..._vendor import _convert_request
-from ...operations._update_operations import build_recommendation_request
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-
-class UpdateOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
- :attr:`update` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs) -> None:
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- async def _recommendation_initial(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: Union[List[_models.RecommendationPatch], IO],
- **kwargs: Any
- ) -> _models.Recommendation:
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(recommendation_patch, (IO, bytes)):
- _content = recommendation_patch
- else:
- _json = self._serialize.body(recommendation_patch, "[RecommendationPatch]")
-
- request = build_recommendation_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- recommendation_id=recommendation_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self._recommendation_initial.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [202]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Recommendation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- _recommendation_initial.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}"
- }
-
- @overload
- async def begin_recommendation(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: List[_models.RecommendationPatch],
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> AsyncLROPoller[_models.Recommendation]:
- """Patch a recommendation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :param recommendation_patch: Recommendation Fields to Update. Required.
- :type recommendation_patch: list[~azure.mgmt.securityinsight.models.RecommendationPatch]
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
- this operation to not poll, or pass in your own initialized polling object for a personal
- polling strategy.
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of AsyncLROPoller that returns either Recommendation or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.Recommendation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def begin_recommendation(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> AsyncLROPoller[_models.Recommendation]:
- """Patch a recommendation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :param recommendation_patch: Recommendation Fields to Update. Required.
- :type recommendation_patch: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
- this operation to not poll, or pass in your own initialized polling object for a personal
- polling strategy.
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of AsyncLROPoller that returns either Recommendation or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.Recommendation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def begin_recommendation(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: Union[List[_models.RecommendationPatch], IO],
- **kwargs: Any
- ) -> AsyncLROPoller[_models.Recommendation]:
- """Patch a recommendation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :param recommendation_patch: Recommendation Fields to Update. Is either a list type or a IO
- type. Required.
- :type recommendation_patch: list[~azure.mgmt.securityinsight.models.RecommendationPatch] or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
- this operation to not poll, or pass in your own initialized polling object for a personal
- polling strategy.
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of AsyncLROPoller that returns either Recommendation or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.Recommendation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
- polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
- if cont_token is None:
- raw_result = await self._recommendation_initial(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- recommendation_id=recommendation_id,
- recommendation_patch=recommendation_patch,
- api_version=api_version,
- content_type=content_type,
- cls=lambda x, y, z: x,
- headers=_headers,
- params=_params,
- **kwargs
- )
- kwargs.pop("error_map", None)
-
- def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("Recommendation", pipeline_response)
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
-
- if polling is True:
- polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
- elif polling is False:
- polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
- else:
- polling_method = polling
- if cont_token:
- return AsyncLROPoller.from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
-
- begin_recommendation.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlist_items_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlist_items_operations.py
index 913eefeee849..b035e8cffbcb 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlist_items_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlist_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,15 +20,13 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._watchlist_items_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +34,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -72,21 +70,20 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.WatchlistItem"]:
- """Gets all watchlist Items.
+ """Get all watchlist Items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
:param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
a previous response contains a nextLink element, the value of the nextLink element will include
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either WatchlistItem or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.WatchlistItem]
@@ -95,12 +92,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WatchlistItemList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -111,19 +106,17 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
subscription_id=self._config.subscription_id,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -135,13 +128,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("WatchlistItemList", pipeline_response)
@@ -151,10 +143,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -166,31 +159,26 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
) -> _models.WatchlistItem:
- """Gets a watchlist, without its watchlist items.
+ """Get a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -201,27 +189,24 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WatchlistItem] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
watchlist_item_id=watchlist_item_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -230,19 +215,15 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("WatchlistItem", pipeline_response)
+ deserialized = self._deserialize("WatchlistItem", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
+ return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
) -> None:
"""Delete a watchlist item.
@@ -252,16 +233,15 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -272,27 +252,24 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
watchlist_item_id=watchlist_item_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -302,11 +279,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
async def create_or_update(
@@ -320,23 +293,22 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.WatchlistItem:
- """Creates or updates a watchlist item.
+ """Create or update a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
:param watchlist_item: The watchlist item. Required.
:type watchlist_item: ~azure.mgmt.securityinsight.models.WatchlistItem
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
@@ -349,28 +321,27 @@ async def create_or_update(
workspace_name: str,
watchlist_alias: str,
watchlist_item_id: str,
- watchlist_item: IO,
+ watchlist_item: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.WatchlistItem:
- """Creates or updates a watchlist item.
+ """Create or update a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
:param watchlist_item: The watchlist item. Required.
- :type watchlist_item: IO
+ :type watchlist_item: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
@@ -383,31 +354,28 @@ async def create_or_update(
workspace_name: str,
watchlist_alias: str,
watchlist_item_id: str,
- watchlist_item: Union[_models.WatchlistItem, IO],
+ watchlist_item: Union[_models.WatchlistItem, IO[bytes]],
**kwargs: Any
) -> _models.WatchlistItem:
- """Creates or updates a watchlist item.
+ """Create or update a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
- :param watchlist_item: The watchlist item. Is either a model type or a IO type. Required.
- :type watchlist_item: ~azure.mgmt.securityinsight.models.WatchlistItem or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param watchlist_item: The watchlist item. Is either a WatchlistItem type or a IO[bytes] type.
+ Required.
+ :type watchlist_item: ~azure.mgmt.securityinsight.models.WatchlistItem or IO[bytes]
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -418,21 +386,19 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.WatchlistItem] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(watchlist_item, (IO, bytes)):
+ if isinstance(watchlist_item, (IOBase, bytes)):
_content = watchlist_item
else:
_json = self._serialize.body(watchlist_item, "WatchlistItem")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
@@ -442,15 +408,14 @@ async def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -459,17 +424,9 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("WatchlistItem", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("WatchlistItem", pipeline_response)
+ deserialized = self._deserialize("WatchlistItem", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
-
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlists_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlists_operations.py
index 2028bb0b5458..82575851cc98 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlists_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_watchlists_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,8 +5,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -17,18 +17,20 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._watchlists_operations import (
build_create_or_update_request,
build_delete_request,
@@ -36,10 +38,10 @@
build_list_request,
)
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -67,7 +69,7 @@ def __init__(self, *args, **kwargs) -> None:
def list(
self, resource_group_name: str, workspace_name: str, skip_token: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.Watchlist"]:
- """Gets all watchlists, without watchlist items.
+ """Get all watchlists, without watchlist items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -79,7 +81,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Watchlist or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -87,12 +88,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WatchlistList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -103,18 +102,16 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -126,13 +123,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("WatchlistList", pipeline_response)
@@ -142,10 +138,11 @@ async def extract_data(pipeline_response):
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -157,29 +154,24 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists"
- }
-
@distributed_trace_async
async def get(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
) -> _models.Watchlist:
- """Gets a watchlist, without its watchlist items.
+ """Get a watchlist, without its watchlist items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Watchlist or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Watchlist
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -190,26 +182,23 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Watchlist] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -218,21 +207,76 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Watchlist", pipeline_response)
+ deserialized = self._deserialize("Watchlist", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ async def _delete_initial(
+ self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ watchlist_alias=watchlist_alias,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
- return deserialized
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def begin_delete(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
- ) -> None:
+ ) -> AsyncLROPoller[None]:
"""Delete a watchlist.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -240,14 +284,65 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ watchlist_alias=watchlist_alias,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ async def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ watchlist: Union[_models.Watchlist, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -255,52 +350,67 @@ async def delete( # pylint: disable=inconsistent-return-statements
}
error_map.update(kwargs.pop("error_map", {}) or {})
- _headers = kwargs.pop("headers", {}) or {}
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
- request = build_delete_request(
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(watchlist, (IOBase, bytes)):
+ _content = watchlist
+ else:
+ _json = self._serialize.body(watchlist, "Watchlist")
+
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
+ content_type=content_type,
+ json=_json,
+ content=_content,
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200, 204]:
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
response_headers = {}
- if response.status_code == 200:
+ if response.status_code == 201:
response_headers["Azure-AsyncOperation"] = self._deserialize(
"str", response.headers.get("Azure-AsyncOperation")
)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, response_headers)
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
+ return deserialized # type: ignore
@overload
- async def create_or_update(
+ async def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
@@ -309,168 +419,136 @@ async def create_or_update(
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.Watchlist:
+ ) -> AsyncLROPoller[_models.Watchlist]:
"""Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv
- content type). To create a Watchlist and its Items, we should call this endpoint with either
- rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for
- small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large
- watchlist, where the content size can go up to 500 MB. The status of processing such large file
- can be polled through the URL returned in Azure-AsyncOperation header.
+ content type). To create a Watchlist and its Items, we should call this endpoint with
+ rawContent and contentType properties.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
:param watchlist: The watchlist. Required.
:type watchlist: ~azure.mgmt.securityinsight.models.Watchlist
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Watchlist or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Watchlist
+ :return: An instance of AsyncLROPoller that returns either Watchlist or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- async def create_or_update(
+ async def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
watchlist_alias: str,
- watchlist: IO,
+ watchlist: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.Watchlist:
+ ) -> AsyncLROPoller[_models.Watchlist]:
"""Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv
- content type). To create a Watchlist and its Items, we should call this endpoint with either
- rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for
- small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large
- watchlist, where the content size can go up to 500 MB. The status of processing such large file
- can be polled through the URL returned in Azure-AsyncOperation header.
+ content type). To create a Watchlist and its Items, we should call this endpoint with
+ rawContent and contentType properties.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
:param watchlist: The watchlist. Required.
- :type watchlist: IO
+ :type watchlist: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Watchlist or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Watchlist
+ :return: An instance of AsyncLROPoller that returns either Watchlist or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
- async def create_or_update(
+ async def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
watchlist_alias: str,
- watchlist: Union[_models.Watchlist, IO],
+ watchlist: Union[_models.Watchlist, IO[bytes]],
**kwargs: Any
- ) -> _models.Watchlist:
+ ) -> AsyncLROPoller[_models.Watchlist]:
"""Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv
- content type). To create a Watchlist and its Items, we should call this endpoint with either
- rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for
- small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large
- watchlist, where the content size can go up to 500 MB. The status of processing such large file
- can be polled through the URL returned in Azure-AsyncOperation header.
+ content type). To create a Watchlist and its Items, we should call this endpoint with
+ rawContent and contentType properties.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist: The watchlist. Is either a model type or a IO type. Required.
- :type watchlist: ~azure.mgmt.securityinsight.models.Watchlist or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Watchlist or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Watchlist
+ :param watchlist: The watchlist. Is either a Watchlist type or a IO[bytes] type. Required.
+ :type watchlist: ~azure.mgmt.securityinsight.models.Watchlist or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either Watchlist or the result of
+ cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Watchlist] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(watchlist, (IO, bytes)):
- _content = watchlist
- else:
- _json = self._serialize.body(watchlist, "Watchlist")
-
- request = build_create_or_update_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- watchlist_alias=watchlist_alias,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create_or_update.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- response_headers = {}
- if response.status_code == 200:
- deserialized = self._deserialize("Watchlist", pipeline_response)
-
- if response.status_code == 201:
- response_headers["Azure-AsyncOperation"] = self._deserialize(
- "str", response.headers.get("Azure-AsyncOperation")
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ watchlist_alias=watchlist_alias,
+ watchlist=watchlist,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
)
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
- deserialized = self._deserialize("Watchlist", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
-
- return deserialized # type: ignore
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("Watchlist", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.Watchlist].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.Watchlist](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py
index 805bb3d2b327..f30e0f9c28e8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py
@@ -5,518 +5,367 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._models_py3 import AADCheckRequirements
-from ._models_py3 import AADCheckRequirementsProperties
-from ._models_py3 import AADDataConnector
-from ._models_py3 import AADDataConnectorProperties
-from ._models_py3 import AATPCheckRequirements
-from ._models_py3 import AATPCheckRequirementsProperties
-from ._models_py3 import AATPDataConnector
-from ._models_py3 import AATPDataConnectorProperties
-from ._models_py3 import ASCCheckRequirements
-from ._models_py3 import ASCDataConnector
-from ._models_py3 import ASCDataConnectorProperties
-from ._models_py3 import AccountEntity
-from ._models_py3 import AccountEntityProperties
-from ._models_py3 import ActionPropertiesBase
-from ._models_py3 import ActionRequest
-from ._models_py3 import ActionRequestProperties
-from ._models_py3 import ActionResponse
-from ._models_py3 import ActionResponseProperties
-from ._models_py3 import ActionsList
-from ._models_py3 import ActivityCustomEntityQuery
-from ._models_py3 import ActivityEntityQueriesPropertiesQueryDefinitions
-from ._models_py3 import ActivityEntityQuery
-from ._models_py3 import ActivityEntityQueryTemplate
-from ._models_py3 import ActivityEntityQueryTemplatePropertiesQueryDefinitions
-from ._models_py3 import ActivityTimelineItem
-from ._models_py3 import AddIncidentTaskActionProperties
-from ._models_py3 import AlertDetailsOverride
-from ._models_py3 import AlertPropertyMapping
-from ._models_py3 import AlertRule
-from ._models_py3 import AlertRuleTemplate
-from ._models_py3 import AlertRuleTemplateDataSource
-from ._models_py3 import AlertRuleTemplatePropertiesBase
-from ._models_py3 import AlertRuleTemplateWithMitreProperties
-from ._models_py3 import AlertRuleTemplatesList
-from ._models_py3 import AlertRulesList
-from ._models_py3 import AlertsDataTypeOfDataConnector
-from ._models_py3 import Anomalies
-from ._models_py3 import AnomalySecurityMLAnalyticsSettings
-from ._models_py3 import AnomalyTimelineItem
-from ._models_py3 import AutomationRule
-from ._models_py3 import AutomationRuleAction
-from ._models_py3 import AutomationRuleAddIncidentTaskAction
-from ._models_py3 import AutomationRuleBooleanCondition
-from ._models_py3 import AutomationRuleCondition
-from ._models_py3 import AutomationRuleModifyPropertiesAction
-from ._models_py3 import AutomationRulePropertyArrayChangedValuesCondition
-from ._models_py3 import AutomationRulePropertyArrayValuesCondition
-from ._models_py3 import AutomationRulePropertyValuesChangedCondition
-from ._models_py3 import AutomationRulePropertyValuesCondition
-from ._models_py3 import AutomationRuleRunPlaybookAction
-from ._models_py3 import AutomationRuleTriggeringLogic
-from ._models_py3 import AutomationRulesList
-from ._models_py3 import Availability
-from ._models_py3 import AwsCloudTrailCheckRequirements
-from ._models_py3 import AwsCloudTrailDataConnector
-from ._models_py3 import AwsCloudTrailDataConnectorDataTypes
-from ._models_py3 import AwsCloudTrailDataConnectorDataTypesLogs
-from ._models_py3 import AwsS3CheckRequirements
-from ._models_py3 import AwsS3DataConnector
-from ._models_py3 import AwsS3DataConnectorDataTypes
-from ._models_py3 import AwsS3DataConnectorDataTypesLogs
-from ._models_py3 import AzureDevOpsResourceInfo
-from ._models_py3 import AzureResourceEntity
-from ._models_py3 import AzureResourceEntityProperties
-from ._models_py3 import Bookmark
-from ._models_py3 import BookmarkEntityMappings
-from ._models_py3 import BookmarkExpandParameters
-from ._models_py3 import BookmarkExpandResponse
-from ._models_py3 import BookmarkExpandResponseValue
-from ._models_py3 import BookmarkList
-from ._models_py3 import BookmarkTimelineItem
-from ._models_py3 import BooleanConditionProperties
-from ._models_py3 import ClientInfo
-from ._models_py3 import CloudApplicationEntity
-from ._models_py3 import CloudApplicationEntityProperties
-from ._models_py3 import CloudErrorBody
-from ._models_py3 import CodelessApiPollingDataConnector
-from ._models_py3 import CodelessConnectorPollingAuthProperties
-from ._models_py3 import CodelessConnectorPollingConfigProperties
-from ._models_py3 import CodelessConnectorPollingPagingProperties
-from ._models_py3 import CodelessConnectorPollingRequestProperties
-from ._models_py3 import CodelessConnectorPollingResponseProperties
-from ._models_py3 import CodelessUiConnectorConfigProperties
-from ._models_py3 import CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem
-from ._models_py3 import CodelessUiConnectorConfigPropertiesDataTypesItem
-from ._models_py3 import CodelessUiConnectorConfigPropertiesGraphQueriesItem
-from ._models_py3 import CodelessUiConnectorConfigPropertiesInstructionStepsItem
-from ._models_py3 import CodelessUiConnectorConfigPropertiesSampleQueriesItem
-from ._models_py3 import CodelessUiDataConnector
-from ._models_py3 import ConnectedEntity
-from ._models_py3 import ConnectivityCriteria
-from ._models_py3 import ConnectorInstructionModelBase
-from ._models_py3 import Content
-from ._models_py3 import ContentPathMap
-from ._models_py3 import CustomEntityQuery
-from ._models_py3 import Customs
-from ._models_py3 import CustomsPermission
-from ._models_py3 import DataConnector
-from ._models_py3 import DataConnectorConnectBody
-from ._models_py3 import DataConnectorDataTypeCommon
-from ._models_py3 import DataConnectorList
-from ._models_py3 import DataConnectorRequirementsState
-from ._models_py3 import DataConnectorTenantId
-from ._models_py3 import DataConnectorWithAlertsProperties
-from ._models_py3 import DataConnectorsCheckRequirements
-from ._models_py3 import DataTypeDefinitions
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentInfo
-from ._models_py3 import DnsEntity
-from ._models_py3 import DnsEntityProperties
-from ._models_py3 import Dynamics365CheckRequirements
-from ._models_py3 import Dynamics365CheckRequirementsProperties
-from ._models_py3 import Dynamics365DataConnector
-from ._models_py3 import Dynamics365DataConnectorDataTypes
-from ._models_py3 import Dynamics365DataConnectorDataTypesDynamics365CdsActivities
-from ._models_py3 import Dynamics365DataConnectorProperties
-from ._models_py3 import EnrichmentDomainWhois
-from ._models_py3 import EnrichmentDomainWhoisContact
-from ._models_py3 import EnrichmentDomainWhoisContacts
-from ._models_py3 import EnrichmentDomainWhoisDetails
-from ._models_py3 import EnrichmentDomainWhoisRegistrarDetails
-from ._models_py3 import EnrichmentIpGeodata
-from ._models_py3 import Entity
-from ._models_py3 import EntityAnalytics
-from ._models_py3 import EntityCommonProperties
-from ._models_py3 import EntityEdges
-from ._models_py3 import EntityExpandParameters
-from ._models_py3 import EntityExpandResponse
-from ._models_py3 import EntityExpandResponseValue
-from ._models_py3 import EntityFieldMapping
-from ._models_py3 import EntityGetInsightsParameters
-from ._models_py3 import EntityGetInsightsResponse
-from ._models_py3 import EntityInsightItem
-from ._models_py3 import EntityInsightItemQueryTimeInterval
-from ._models_py3 import EntityList
-from ._models_py3 import EntityMapping
-from ._models_py3 import EntityQuery
-from ._models_py3 import EntityQueryItem
-from ._models_py3 import EntityQueryItemProperties
-from ._models_py3 import EntityQueryItemPropertiesDataTypesItem
-from ._models_py3 import EntityQueryList
-from ._models_py3 import EntityQueryTemplate
-from ._models_py3 import EntityQueryTemplateList
-from ._models_py3 import EntityTimelineItem
-from ._models_py3 import EntityTimelineParameters
-from ._models_py3 import EntityTimelineResponse
-from ._models_py3 import EventGroupingSettings
-from ._models_py3 import ExpansionEntityQuery
-from ._models_py3 import ExpansionResultAggregation
-from ._models_py3 import ExpansionResultsMetadata
-from ._models_py3 import EyesOn
-from ._models_py3 import FieldMapping
-from ._models_py3 import FileEntity
-from ._models_py3 import FileEntityProperties
-from ._models_py3 import FileHashEntity
-from ._models_py3 import FileHashEntityProperties
-from ._models_py3 import FileImport
-from ._models_py3 import FileImportList
-from ._models_py3 import FileMetadata
-from ._models_py3 import FusionAlertRule
-from ._models_py3 import FusionAlertRuleTemplate
-from ._models_py3 import FusionScenarioExclusionPattern
-from ._models_py3 import FusionSourceSettings
-from ._models_py3 import FusionSourceSubTypeSetting
-from ._models_py3 import FusionSubTypeSeverityFilter
-from ._models_py3 import FusionSubTypeSeverityFiltersItem
-from ._models_py3 import FusionTemplateSourceSetting
-from ._models_py3 import FusionTemplateSourceSubType
-from ._models_py3 import FusionTemplateSubTypeSeverityFilter
-from ._models_py3 import GeoLocation
-from ._models_py3 import GetInsightsErrorKind
-from ._models_py3 import GetInsightsResultsMetadata
-from ._models_py3 import GetQueriesResponse
-from ._models_py3 import GitHubResourceInfo
-from ._models_py3 import GraphQueries
-from ._models_py3 import GroupingConfiguration
-from ._models_py3 import HostEntity
-from ._models_py3 import HostEntityProperties
-from ._models_py3 import HuntingBookmark
-from ._models_py3 import HuntingBookmarkProperties
-from ._models_py3 import Incident
-from ._models_py3 import IncidentAdditionalData
-from ._models_py3 import IncidentAlertList
-from ._models_py3 import IncidentBookmarkList
-from ._models_py3 import IncidentComment
-from ._models_py3 import IncidentCommentList
-from ._models_py3 import IncidentConfiguration
-from ._models_py3 import IncidentEntitiesResponse
-from ._models_py3 import IncidentEntitiesResultsMetadata
-from ._models_py3 import IncidentInfo
-from ._models_py3 import IncidentLabel
-from ._models_py3 import IncidentList
-from ._models_py3 import IncidentOwnerInfo
-from ._models_py3 import IncidentPropertiesAction
-from ._models_py3 import IncidentTask
-from ._models_py3 import IncidentTaskList
-from ._models_py3 import InsightQueryItem
-from ._models_py3 import InsightQueryItemProperties
-from ._models_py3 import InsightQueryItemPropertiesAdditionalQuery
-from ._models_py3 import InsightQueryItemPropertiesDefaultTimeRange
-from ._models_py3 import InsightQueryItemPropertiesReferenceTimeRange
-from ._models_py3 import InsightQueryItemPropertiesTableQuery
-from ._models_py3 import InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem
-from ._models_py3 import InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem
-from ._models_py3 import InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem
-from ._models_py3 import InsightsTableResult
-from ._models_py3 import InsightsTableResultColumnsItem
-from ._models_py3 import InstructionSteps
-from ._models_py3 import InstructionStepsInstructionsItem
-from ._models_py3 import Instructions
-from ._models_py3 import IoTCheckRequirements
-from ._models_py3 import IoTDataConnector
-from ._models_py3 import IoTDataConnectorProperties
-from ._models_py3 import IoTDeviceEntity
-from ._models_py3 import IoTDeviceEntityProperties
-from ._models_py3 import IpEntity
-from ._models_py3 import IpEntityProperties
-from ._models_py3 import LastDataReceivedDataType
-from ._models_py3 import MCASCheckRequirements
-from ._models_py3 import MCASCheckRequirementsProperties
-from ._models_py3 import MCASDataConnector
-from ._models_py3 import MCASDataConnectorDataTypes
-from ._models_py3 import MCASDataConnectorProperties
-from ._models_py3 import MDATPCheckRequirements
-from ._models_py3 import MDATPCheckRequirementsProperties
-from ._models_py3 import MDATPDataConnector
-from ._models_py3 import MDATPDataConnectorProperties
-from ._models_py3 import MLBehaviorAnalyticsAlertRule
-from ._models_py3 import MLBehaviorAnalyticsAlertRuleTemplate
-from ._models_py3 import MLBehaviorAnalyticsAlertRuleTemplateProperties
-from ._models_py3 import MSTICheckRequirements
-from ._models_py3 import MSTICheckRequirementsProperties
-from ._models_py3 import MSTIDataConnector
-from ._models_py3 import MSTIDataConnectorDataTypes
-from ._models_py3 import MSTIDataConnectorDataTypesBingSafetyPhishingURL
-from ._models_py3 import MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed
-from ._models_py3 import MSTIDataConnectorProperties
-from ._models_py3 import MTPCheckRequirementsProperties
-from ._models_py3 import MTPDataConnector
-from ._models_py3 import MTPDataConnectorDataTypes
-from ._models_py3 import MTPDataConnectorDataTypesIncidents
-from ._models_py3 import MTPDataConnectorProperties
-from ._models_py3 import MailClusterEntity
-from ._models_py3 import MailClusterEntityProperties
-from ._models_py3 import MailMessageEntity
-from ._models_py3 import MailMessageEntityProperties
-from ._models_py3 import MailboxEntity
-from ._models_py3 import MailboxEntityProperties
-from ._models_py3 import MalwareEntity
-from ._models_py3 import MalwareEntityProperties
-from ._models_py3 import ManualTriggerRequestBody
-from ._models_py3 import MetadataAuthor
-from ._models_py3 import MetadataCategories
-from ._models_py3 import MetadataDependencies
-from ._models_py3 import MetadataList
-from ._models_py3 import MetadataModel
-from ._models_py3 import MetadataPatch
-from ._models_py3 import MetadataSource
-from ._models_py3 import MetadataSupport
-from ._models_py3 import MicrosoftSecurityIncidentCreationAlertRule
-from ._models_py3 import MicrosoftSecurityIncidentCreationAlertRuleCommonProperties
-from ._models_py3 import MicrosoftSecurityIncidentCreationAlertRuleProperties
-from ._models_py3 import MicrosoftSecurityIncidentCreationAlertRuleTemplate
-from ._models_py3 import MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties
-from ._models_py3 import MtpCheckRequirements
-from ._models_py3 import NicEntity
-from ._models_py3 import NicEntityProperties
-from ._models_py3 import NrtAlertRule
-from ._models_py3 import NrtAlertRuleTemplate
-from ._models_py3 import NrtAlertRuleTemplateProperties
-from ._models_py3 import Office365ProjectCheckRequirements
-from ._models_py3 import Office365ProjectCheckRequirementsProperties
-from ._models_py3 import Office365ProjectConnectorDataTypes
-from ._models_py3 import Office365ProjectConnectorDataTypesLogs
-from ._models_py3 import Office365ProjectDataConnector
-from ._models_py3 import Office365ProjectDataConnectorProperties
-from ._models_py3 import OfficeATPCheckRequirements
-from ._models_py3 import OfficeATPCheckRequirementsProperties
-from ._models_py3 import OfficeATPDataConnector
-from ._models_py3 import OfficeATPDataConnectorProperties
-from ._models_py3 import OfficeConsent
-from ._models_py3 import OfficeConsentList
-from ._models_py3 import OfficeDataConnector
-from ._models_py3 import OfficeDataConnectorDataTypes
-from ._models_py3 import OfficeDataConnectorDataTypesExchange
-from ._models_py3 import OfficeDataConnectorDataTypesSharePoint
-from ._models_py3 import OfficeDataConnectorDataTypesTeams
-from ._models_py3 import OfficeDataConnectorProperties
-from ._models_py3 import OfficeIRMCheckRequirements
-from ._models_py3 import OfficeIRMCheckRequirementsProperties
-from ._models_py3 import OfficeIRMDataConnector
-from ._models_py3 import OfficeIRMDataConnectorProperties
-from ._models_py3 import OfficePowerBICheckRequirements
-from ._models_py3 import OfficePowerBICheckRequirementsProperties
-from ._models_py3 import OfficePowerBIConnectorDataTypes
-from ._models_py3 import OfficePowerBIConnectorDataTypesLogs
-from ._models_py3 import OfficePowerBIDataConnector
-from ._models_py3 import OfficePowerBIDataConnectorProperties
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationsList
-from ._models_py3 import Permissions
-from ._models_py3 import PermissionsCustomsItem
-from ._models_py3 import PermissionsResourceProviderItem
-from ._models_py3 import PlaybookActionProperties
-from ._models_py3 import ProcessEntity
-from ._models_py3 import ProcessEntityProperties
-from ._models_py3 import PropertyArrayChangedConditionProperties
-from ._models_py3 import PropertyArrayConditionProperties
-from ._models_py3 import PropertyChangedConditionProperties
-from ._models_py3 import PropertyConditionProperties
-from ._models_py3 import QueryBasedAlertRuleTemplateProperties
-from ._models_py3 import Recommendation
-from ._models_py3 import RecommendationList
-from ._models_py3 import RecommendationPatch
-from ._models_py3 import RecommendedAction
-from ._models_py3 import RegistryKeyEntity
-from ._models_py3 import RegistryKeyEntityProperties
-from ._models_py3 import RegistryValueEntity
-from ._models_py3 import RegistryValueEntityProperties
-from ._models_py3 import Relation
-from ._models_py3 import RelationList
-from ._models_py3 import Repo
-from ._models_py3 import RepoList
-from ._models_py3 import Repository
-from ._models_py3 import RepositoryResourceInfo
-from ._models_py3 import RequiredPermissions
-from ._models_py3 import Resource
-from ._models_py3 import ResourceProvider
-from ._models_py3 import ResourceWithEtag
-from ._models_py3 import SampleQueries
-from ._models_py3 import ScheduledAlertRule
-from ._models_py3 import ScheduledAlertRuleCommonProperties
-from ._models_py3 import ScheduledAlertRuleProperties
-from ._models_py3 import ScheduledAlertRuleTemplate
-from ._models_py3 import SecurityAlert
-from ._models_py3 import SecurityAlertProperties
-from ._models_py3 import SecurityAlertPropertiesConfidenceReasonsItem
-from ._models_py3 import SecurityAlertTimelineItem
-from ._models_py3 import SecurityGroupEntity
-from ._models_py3 import SecurityGroupEntityProperties
-from ._models_py3 import SecurityMLAnalyticsSetting
-from ._models_py3 import SecurityMLAnalyticsSettingsDataSource
-from ._models_py3 import SecurityMLAnalyticsSettingsList
-from ._models_py3 import SentinelEntityMapping
-from ._models_py3 import SentinelOnboardingState
-from ._models_py3 import SentinelOnboardingStatesList
-from ._models_py3 import SettingList
-from ._models_py3 import Settings
-from ._models_py3 import SourceControl
-from ._models_py3 import SourceControlList
-from ._models_py3 import SubmissionMailEntity
-from ._models_py3 import SubmissionMailEntityProperties
-from ._models_py3 import SystemData
-from ._models_py3 import TICheckRequirements
-from ._models_py3 import TICheckRequirementsProperties
-from ._models_py3 import TIDataConnector
-from ._models_py3 import TIDataConnectorDataTypes
-from ._models_py3 import TIDataConnectorDataTypesIndicators
-from ._models_py3 import TIDataConnectorProperties
-from ._models_py3 import TeamInformation
-from ._models_py3 import TeamProperties
-from ._models_py3 import ThreatIntelligence
-from ._models_py3 import ThreatIntelligenceAlertRule
-from ._models_py3 import ThreatIntelligenceAlertRuleTemplate
-from ._models_py3 import ThreatIntelligenceAlertRuleTemplateProperties
-from ._models_py3 import ThreatIntelligenceAppendTags
-from ._models_py3 import ThreatIntelligenceExternalReference
-from ._models_py3 import ThreatIntelligenceFilteringCriteria
-from ._models_py3 import ThreatIntelligenceGranularMarkingModel
-from ._models_py3 import ThreatIntelligenceIndicatorModel
-from ._models_py3 import ThreatIntelligenceIndicatorProperties
-from ._models_py3 import ThreatIntelligenceInformation
-from ._models_py3 import ThreatIntelligenceInformationList
-from ._models_py3 import ThreatIntelligenceKillChainPhase
-from ._models_py3 import ThreatIntelligenceMetric
-from ._models_py3 import ThreatIntelligenceMetricEntity
-from ._models_py3 import ThreatIntelligenceMetrics
-from ._models_py3 import ThreatIntelligenceMetricsList
-from ._models_py3 import ThreatIntelligenceParsedPattern
-from ._models_py3 import ThreatIntelligenceParsedPatternTypeValue
-from ._models_py3 import ThreatIntelligenceSortingCriteria
-from ._models_py3 import TiTaxiiCheckRequirements
-from ._models_py3 import TiTaxiiCheckRequirementsProperties
-from ._models_py3 import TiTaxiiDataConnector
-from ._models_py3 import TiTaxiiDataConnectorDataTypes
-from ._models_py3 import TiTaxiiDataConnectorDataTypesTaxiiClient
-from ._models_py3 import TiTaxiiDataConnectorProperties
-from ._models_py3 import TimelineAggregation
-from ._models_py3 import TimelineError
-from ._models_py3 import TimelineResultsMetadata
-from ._models_py3 import Ueba
-from ._models_py3 import UrlEntity
-from ._models_py3 import UrlEntityProperties
-from ._models_py3 import UserInfo
-from ._models_py3 import ValidationError
-from ._models_py3 import Watchlist
-from ._models_py3 import WatchlistItem
-from ._models_py3 import WatchlistItemList
-from ._models_py3 import WatchlistList
-from ._models_py3 import Webhook
+from typing import TYPE_CHECKING
-from ._security_insights_enums import ActionType
-from ._security_insights_enums import AlertDetail
-from ._security_insights_enums import AlertProperty
-from ._security_insights_enums import AlertRuleKind
-from ._security_insights_enums import AlertSeverity
-from ._security_insights_enums import AlertStatus
-from ._security_insights_enums import AntispamMailDirection
-from ._security_insights_enums import AttackTactic
-from ._security_insights_enums import AutomationRuleBooleanConditionSupportedOperator
-from ._security_insights_enums import AutomationRulePropertyArrayChangedConditionSupportedArrayType
-from ._security_insights_enums import AutomationRulePropertyArrayChangedConditionSupportedChangeType
-from ._security_insights_enums import AutomationRulePropertyArrayConditionSupportedArrayConditionType
-from ._security_insights_enums import AutomationRulePropertyArrayConditionSupportedArrayType
-from ._security_insights_enums import AutomationRulePropertyChangedConditionSupportedChangedType
-from ._security_insights_enums import AutomationRulePropertyChangedConditionSupportedPropertyType
-from ._security_insights_enums import AutomationRulePropertyConditionSupportedOperator
-from ._security_insights_enums import AutomationRulePropertyConditionSupportedProperty
-from ._security_insights_enums import Category
-from ._security_insights_enums import ConditionType
-from ._security_insights_enums import ConfidenceLevel
-from ._security_insights_enums import ConfidenceScoreStatus
-from ._security_insights_enums import ConnectAuthKind
-from ._security_insights_enums import ConnectivityType
-from ._security_insights_enums import ContentType
-from ._security_insights_enums import Context
-from ._security_insights_enums import CreatedByType
-from ._security_insights_enums import CustomEntityQueryKind
-from ._security_insights_enums import DataConnectorAuthorizationState
-from ._security_insights_enums import DataConnectorKind
-from ._security_insights_enums import DataConnectorLicenseState
-from ._security_insights_enums import DataTypeState
-from ._security_insights_enums import DeleteStatus
-from ._security_insights_enums import DeliveryAction
-from ._security_insights_enums import DeliveryLocation
-from ._security_insights_enums import DeploymentFetchStatus
-from ._security_insights_enums import DeploymentResult
-from ._security_insights_enums import DeploymentState
-from ._security_insights_enums import DeviceImportance
-from ._security_insights_enums import ElevationToken
-from ._security_insights_enums import EntityItemQueryKind
-from ._security_insights_enums import EntityKind
-from ._security_insights_enums import EntityMappingType
-from ._security_insights_enums import EntityProviders
-from ._security_insights_enums import EntityQueryKind
-from ._security_insights_enums import EntityQueryTemplateKind
-from ._security_insights_enums import EntityTimelineKind
-from ._security_insights_enums import EntityType
-from ._security_insights_enums import Enum13
-from ._security_insights_enums import Enum15
-from ._security_insights_enums import EventGroupingAggregationKind
-from ._security_insights_enums import FileFormat
-from ._security_insights_enums import FileHashAlgorithm
-from ._security_insights_enums import FileImportContentType
-from ._security_insights_enums import FileImportState
-from ._security_insights_enums import GetInsightsError
-from ._security_insights_enums import IncidentClassification
-from ._security_insights_enums import IncidentClassificationReason
-from ._security_insights_enums import IncidentLabelType
-from ._security_insights_enums import IncidentSeverity
-from ._security_insights_enums import IncidentStatus
-from ._security_insights_enums import IncidentTaskStatus
-from ._security_insights_enums import IngestionMode
-from ._security_insights_enums import KillChainIntent
-from ._security_insights_enums import Kind
-from ._security_insights_enums import MatchingMethod
-from ._security_insights_enums import MicrosoftSecurityProductName
-from ._security_insights_enums import OSFamily
-from ._security_insights_enums import Operator
-from ._security_insights_enums import OutputType
-from ._security_insights_enums import OwnerType
-from ._security_insights_enums import PermissionProviderScope
-from ._security_insights_enums import PollingFrequency
-from ._security_insights_enums import Priority
-from ._security_insights_enums import ProviderName
-from ._security_insights_enums import RegistryHive
-from ._security_insights_enums import RegistryValueKind
-from ._security_insights_enums import RepoType
-from ._security_insights_enums import SecurityMLAnalyticsSettingsKind
-from ._security_insights_enums import SettingKind
-from ._security_insights_enums import SettingType
-from ._security_insights_enums import SettingsStatus
-from ._security_insights_enums import SourceKind
-from ._security_insights_enums import SourceType
-from ._security_insights_enums import State
-from ._security_insights_enums import SupportTier
-from ._security_insights_enums import TemplateStatus
-from ._security_insights_enums import ThreatIntelligenceResourceKindEnum
-from ._security_insights_enums import ThreatIntelligenceSortingCriteriaEnum
-from ._security_insights_enums import TriggerOperator
-from ._security_insights_enums import TriggersOn
-from ._security_insights_enums import TriggersWhen
-from ._security_insights_enums import UebaDataSources
-from ._security_insights_enums import Version
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AADDataConnector,
+ AATPDataConnector,
+ ASCDataConnector,
+ ASCDataConnectorProperties,
+ AWSAuthModel,
+ AccountEntity,
+ AccountEntityProperties,
+ ActionPropertiesBase,
+ ActionRequest,
+ ActionRequestProperties,
+ ActionResponse,
+ ActionResponseProperties,
+ ActionsList,
+ AddIncidentTaskActionProperties,
+ AlertDetailsOverride,
+ AlertPropertyMapping,
+ AlertRule,
+ AlertRuleTemplate,
+ AlertRuleTemplateDataSource,
+ AlertRuleTemplatesList,
+ AlertRulesList,
+ AlertsDataTypeOfDataConnector,
+ AnomalySecurityMLAnalyticsSettings,
+ ApiKeyAuthModel,
+ AutomationRule,
+ AutomationRuleAction,
+ AutomationRuleAddIncidentTaskAction,
+ AutomationRuleBooleanCondition,
+ AutomationRuleCondition,
+ AutomationRuleModifyPropertiesAction,
+ AutomationRulePropertyArrayChangedValuesCondition,
+ AutomationRulePropertyArrayValuesCondition,
+ AutomationRulePropertyValuesChangedCondition,
+ AutomationRulePropertyValuesCondition,
+ AutomationRuleRunPlaybookAction,
+ AutomationRuleTriggeringLogic,
+ AutomationRulesList,
+ AwsCloudTrailDataConnector,
+ AwsCloudTrailDataConnectorDataTypes,
+ AwsCloudTrailDataConnectorDataTypesLogs,
+ AzureDevOpsResourceInfo,
+ AzureResourceEntity,
+ AzureResourceEntityProperties,
+ BasicAuthModel,
+ Bookmark,
+ BookmarkList,
+ BooleanConditionProperties,
+ CcpAuthConfig,
+ CcpResponseConfig,
+ ClientInfo,
+ CloudApplicationEntity,
+ CloudApplicationEntityProperties,
+ CloudErrorBody,
+ ConnectivityCriterion,
+ ConnectorDataType,
+ ConnectorDefinitionsAvailability,
+ ConnectorDefinitionsPermissions,
+ ConnectorDefinitionsResourceProvider,
+ CustomPermissionDetails,
+ CustomizableConnectionsConfig,
+ CustomizableConnectorDefinition,
+ CustomizableConnectorUiConfig,
+ DCRConfiguration,
+ DataConnector,
+ DataConnectorDataTypeCommon,
+ DataConnectorDefinition,
+ DataConnectorDefinitionArmCollectionWrapper,
+ DataConnectorList,
+ DataConnectorTenantId,
+ DataConnectorWithAlertsProperties,
+ Deployment,
+ DeploymentInfo,
+ DnsEntity,
+ DnsEntityProperties,
+ Entity,
+ EntityCommonProperties,
+ EntityManualTriggerRequestBody,
+ EntityMapping,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ EventGroupingSettings,
+ FieldMapping,
+ FileEntity,
+ FileEntityProperties,
+ FileHashEntity,
+ FileHashEntityProperties,
+ FusionAlertRule,
+ FusionAlertRuleTemplate,
+ GCPAuthModel,
+ GenericBlobSbsAuthModel,
+ GeoLocation,
+ GitHubAuthModel,
+ GitHubResourceInfo,
+ GraphQuery,
+ GroupingConfiguration,
+ HostEntity,
+ HostEntityProperties,
+ HuntingBookmark,
+ HuntingBookmarkProperties,
+ Incident,
+ IncidentAdditionalData,
+ IncidentAlertList,
+ IncidentBookmarkList,
+ IncidentComment,
+ IncidentCommentList,
+ IncidentConfiguration,
+ IncidentEntitiesResponse,
+ IncidentEntitiesResultsMetadata,
+ IncidentInfo,
+ IncidentLabel,
+ IncidentList,
+ IncidentOwnerInfo,
+ IncidentPropertiesAction,
+ IncidentTask,
+ IncidentTaskList,
+ InstructionStep,
+ InstructionStepDetails,
+ IoTDeviceEntity,
+ IoTDeviceEntityProperties,
+ IpEntity,
+ IpEntityProperties,
+ JwtAuthModel,
+ MCASDataConnector,
+ MCASDataConnectorDataTypes,
+ MDATPDataConnector,
+ MSTIDataConnector,
+ MSTIDataConnectorDataTypes,
+ MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed,
+ MSTIDataConnectorProperties,
+ MailClusterEntity,
+ MailClusterEntityProperties,
+ MailMessageEntity,
+ MailMessageEntityProperties,
+ MailboxEntity,
+ MailboxEntityProperties,
+ MalwareEntity,
+ MalwareEntityProperties,
+ ManualTriggerRequestBody,
+ MetadataAuthor,
+ MetadataCategories,
+ MetadataDependencies,
+ MetadataList,
+ MetadataModel,
+ MetadataPatch,
+ MetadataSource,
+ MetadataSupport,
+ MicrosoftSecurityIncidentCreationAlertRule,
+ MicrosoftSecurityIncidentCreationAlertRuleCommonProperties,
+ MicrosoftSecurityIncidentCreationAlertRuleProperties,
+ MicrosoftSecurityIncidentCreationAlertRuleTemplate,
+ NoneAuthModel,
+ OAuthModel,
+ OfficeDataConnector,
+ OfficeDataConnectorDataTypes,
+ OfficeDataConnectorDataTypesExchange,
+ OfficeDataConnectorDataTypesSharePoint,
+ OfficeDataConnectorDataTypesTeams,
+ Operation,
+ OperationDisplay,
+ OperationsList,
+ OracleAuthModel,
+ PackageBaseProperties,
+ PackageList,
+ PackageModel,
+ PackageProperties,
+ PlaybookActionProperties,
+ PremiumMdtiDataConnectorDataTypes,
+ PremiumMdtiDataConnectorDataTypesConnector,
+ PremiumMdtiDataConnectorProperties,
+ PremiumMicrosoftDefenderForThreatIntelligence,
+ ProcessEntity,
+ ProcessEntityProperties,
+ ProductPackageAdditionalProperties,
+ ProductPackageList,
+ ProductPackageModel,
+ ProductPackageProperties,
+ ProductTemplateAdditionalProperties,
+ ProductTemplateList,
+ ProductTemplateModel,
+ ProductTemplateProperties,
+ PropertyArrayChangedConditionProperties,
+ PropertyArrayConditionProperties,
+ PropertyChangedConditionProperties,
+ PropertyConditionProperties,
+ PullRequest,
+ RegistryKeyEntity,
+ RegistryKeyEntityProperties,
+ RegistryValueEntity,
+ RegistryValueEntityProperties,
+ Relation,
+ RelationList,
+ Repo,
+ RepoList,
+ Repository,
+ RepositoryAccess,
+ RepositoryAccessProperties,
+ RepositoryResourceInfo,
+ Resource,
+ ResourceProviderRequiredPermissions,
+ ResourceWithEtag,
+ RestApiPollerDataConnector,
+ RestApiPollerRequestConfig,
+ RestApiPollerRequestPagingConfig,
+ RestApiPollerRequestPagingCountBaseConfig,
+ RestApiPollerRequestPagingLinkHeaderConfig,
+ RestApiPollerRequestPagingNextPageUrlConfig,
+ RestApiPollerRequestPagingOffsetConfig,
+ RestApiPollerRequestPagingTokenConfig,
+ ScheduledAlertRule,
+ ScheduledAlertRuleCommonProperties,
+ ScheduledAlertRuleProperties,
+ ScheduledAlertRuleTemplate,
+ SecurityAlert,
+ SecurityAlertProperties,
+ SecurityAlertPropertiesConfidenceReasonsItem,
+ SecurityGroupEntity,
+ SecurityGroupEntityProperties,
+ SecurityMLAnalyticsSetting,
+ SecurityMLAnalyticsSettingsDataSource,
+ SecurityMLAnalyticsSettingsList,
+ SentinelOnboardingState,
+ SentinelOnboardingStatesList,
+ ServicePrincipal,
+ SessionAuthModel,
+ SourceControl,
+ SourceControlList,
+ SubmissionMailEntity,
+ SubmissionMailEntityProperties,
+ SystemData,
+ TIDataConnector,
+ TIDataConnectorDataTypes,
+ TIDataConnectorDataTypesIndicators,
+ TemplateAdditionalProperties,
+ TemplateBaseProperties,
+ TemplateList,
+ TemplateModel,
+ TemplateProperties,
+ ThreatIntelligence,
+ ThreatIntelligenceAppendTags,
+ ThreatIntelligenceExternalReference,
+ ThreatIntelligenceFilteringCriteria,
+ ThreatIntelligenceGranularMarkingModel,
+ ThreatIntelligenceIndicatorModel,
+ ThreatIntelligenceIndicatorProperties,
+ ThreatIntelligenceInformation,
+ ThreatIntelligenceInformationList,
+ ThreatIntelligenceKillChainPhase,
+ ThreatIntelligenceMetric,
+ ThreatIntelligenceMetricEntity,
+ ThreatIntelligenceMetrics,
+ ThreatIntelligenceMetricsList,
+ ThreatIntelligenceParsedPattern,
+ ThreatIntelligenceParsedPatternTypeValue,
+ ThreatIntelligenceSortingCriteria,
+ UrlEntity,
+ UrlEntityProperties,
+ UserInfo,
+ Warning,
+ WarningBody,
+ Watchlist,
+ WatchlistItem,
+ WatchlistItemList,
+ WatchlistList,
+ Webhook,
+)
+
+from ._security_insights_enums import ( # type: ignore
+ ActionType,
+ AlertDetail,
+ AlertProperty,
+ AlertRuleKind,
+ AlertSeverity,
+ AlertStatus,
+ AntispamMailDirection,
+ AttackTactic,
+ AutomationRuleBooleanConditionSupportedOperator,
+ AutomationRulePropertyArrayChangedConditionSupportedArrayType,
+ AutomationRulePropertyArrayChangedConditionSupportedChangeType,
+ AutomationRulePropertyArrayConditionSupportedArrayConditionType,
+ AutomationRulePropertyArrayConditionSupportedArrayType,
+ AutomationRulePropertyChangedConditionSupportedChangedType,
+ AutomationRulePropertyChangedConditionSupportedPropertyType,
+ AutomationRulePropertyConditionSupportedOperator,
+ AutomationRulePropertyConditionSupportedProperty,
+ CcpAuthType,
+ ConditionType,
+ ConfidenceLevel,
+ ConfidenceScoreStatus,
+ ContentType,
+ CreatedByType,
+ DataConnectorDefinitionKind,
+ DataConnectorKind,
+ DataTypeState,
+ DeliveryAction,
+ DeliveryLocation,
+ DeploymentFetchStatus,
+ DeploymentResult,
+ DeploymentState,
+ ElevationToken,
+ EntityKindEnum,
+ EntityMappingType,
+ EventGroupingAggregationKind,
+ FileHashAlgorithm,
+ Flag,
+ HttpMethodVerb,
+ IncidentClassification,
+ IncidentClassificationReason,
+ IncidentLabelType,
+ IncidentSeverity,
+ IncidentStatus,
+ IncidentTaskStatus,
+ KillChainIntent,
+ Kind,
+ MatchingMethod,
+ MicrosoftSecurityProductName,
+ OSFamily,
+ Operator,
+ OwnerType,
+ PackageKind,
+ ProviderPermissionsScope,
+ ProvisioningState,
+ RegistryHive,
+ RegistryValueKind,
+ RepoType,
+ RepositoryAccessKind,
+ RestApiPollerRequestPagingKind,
+ SecurityMLAnalyticsSettingsKind,
+ SettingsStatus,
+ SourceKind,
+ SourceType,
+ State,
+ SupportTier,
+ TemplateStatus,
+ ThreatIntelligenceResourceInnerKind,
+ ThreatIntelligenceSortingOrder,
+ TriggerOperator,
+ TriggersOn,
+ TriggersWhen,
+ Version,
+ WarningCode,
+)
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
- "AADCheckRequirements",
- "AADCheckRequirementsProperties",
"AADDataConnector",
- "AADDataConnectorProperties",
- "AATPCheckRequirements",
- "AATPCheckRequirementsProperties",
"AATPDataConnector",
- "AATPDataConnectorProperties",
- "ASCCheckRequirements",
"ASCDataConnector",
"ASCDataConnectorProperties",
+ "AWSAuthModel",
"AccountEntity",
"AccountEntityProperties",
"ActionPropertiesBase",
@@ -525,26 +374,17 @@
"ActionResponse",
"ActionResponseProperties",
"ActionsList",
- "ActivityCustomEntityQuery",
- "ActivityEntityQueriesPropertiesQueryDefinitions",
- "ActivityEntityQuery",
- "ActivityEntityQueryTemplate",
- "ActivityEntityQueryTemplatePropertiesQueryDefinitions",
- "ActivityTimelineItem",
"AddIncidentTaskActionProperties",
"AlertDetailsOverride",
"AlertPropertyMapping",
"AlertRule",
"AlertRuleTemplate",
"AlertRuleTemplateDataSource",
- "AlertRuleTemplatePropertiesBase",
- "AlertRuleTemplateWithMitreProperties",
"AlertRuleTemplatesList",
"AlertRulesList",
"AlertsDataTypeOfDataConnector",
- "Anomalies",
"AnomalySecurityMLAnalyticsSettings",
- "AnomalyTimelineItem",
+ "ApiKeyAuthModel",
"AutomationRule",
"AutomationRuleAction",
"AutomationRuleAddIncidentTaskAction",
@@ -558,129 +398,64 @@
"AutomationRuleRunPlaybookAction",
"AutomationRuleTriggeringLogic",
"AutomationRulesList",
- "Availability",
- "AwsCloudTrailCheckRequirements",
"AwsCloudTrailDataConnector",
"AwsCloudTrailDataConnectorDataTypes",
"AwsCloudTrailDataConnectorDataTypesLogs",
- "AwsS3CheckRequirements",
- "AwsS3DataConnector",
- "AwsS3DataConnectorDataTypes",
- "AwsS3DataConnectorDataTypesLogs",
"AzureDevOpsResourceInfo",
"AzureResourceEntity",
"AzureResourceEntityProperties",
+ "BasicAuthModel",
"Bookmark",
- "BookmarkEntityMappings",
- "BookmarkExpandParameters",
- "BookmarkExpandResponse",
- "BookmarkExpandResponseValue",
"BookmarkList",
- "BookmarkTimelineItem",
"BooleanConditionProperties",
+ "CcpAuthConfig",
+ "CcpResponseConfig",
"ClientInfo",
"CloudApplicationEntity",
"CloudApplicationEntityProperties",
"CloudErrorBody",
- "CodelessApiPollingDataConnector",
- "CodelessConnectorPollingAuthProperties",
- "CodelessConnectorPollingConfigProperties",
- "CodelessConnectorPollingPagingProperties",
- "CodelessConnectorPollingRequestProperties",
- "CodelessConnectorPollingResponseProperties",
- "CodelessUiConnectorConfigProperties",
- "CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem",
- "CodelessUiConnectorConfigPropertiesDataTypesItem",
- "CodelessUiConnectorConfigPropertiesGraphQueriesItem",
- "CodelessUiConnectorConfigPropertiesInstructionStepsItem",
- "CodelessUiConnectorConfigPropertiesSampleQueriesItem",
- "CodelessUiDataConnector",
- "ConnectedEntity",
- "ConnectivityCriteria",
- "ConnectorInstructionModelBase",
- "Content",
- "ContentPathMap",
- "CustomEntityQuery",
- "Customs",
- "CustomsPermission",
+ "ConnectivityCriterion",
+ "ConnectorDataType",
+ "ConnectorDefinitionsAvailability",
+ "ConnectorDefinitionsPermissions",
+ "ConnectorDefinitionsResourceProvider",
+ "CustomPermissionDetails",
+ "CustomizableConnectionsConfig",
+ "CustomizableConnectorDefinition",
+ "CustomizableConnectorUiConfig",
+ "DCRConfiguration",
"DataConnector",
- "DataConnectorConnectBody",
"DataConnectorDataTypeCommon",
+ "DataConnectorDefinition",
+ "DataConnectorDefinitionArmCollectionWrapper",
"DataConnectorList",
- "DataConnectorRequirementsState",
"DataConnectorTenantId",
"DataConnectorWithAlertsProperties",
- "DataConnectorsCheckRequirements",
- "DataTypeDefinitions",
"Deployment",
"DeploymentInfo",
"DnsEntity",
"DnsEntityProperties",
- "Dynamics365CheckRequirements",
- "Dynamics365CheckRequirementsProperties",
- "Dynamics365DataConnector",
- "Dynamics365DataConnectorDataTypes",
- "Dynamics365DataConnectorDataTypesDynamics365CdsActivities",
- "Dynamics365DataConnectorProperties",
- "EnrichmentDomainWhois",
- "EnrichmentDomainWhoisContact",
- "EnrichmentDomainWhoisContacts",
- "EnrichmentDomainWhoisDetails",
- "EnrichmentDomainWhoisRegistrarDetails",
- "EnrichmentIpGeodata",
"Entity",
- "EntityAnalytics",
"EntityCommonProperties",
- "EntityEdges",
- "EntityExpandParameters",
- "EntityExpandResponse",
- "EntityExpandResponseValue",
- "EntityFieldMapping",
- "EntityGetInsightsParameters",
- "EntityGetInsightsResponse",
- "EntityInsightItem",
- "EntityInsightItemQueryTimeInterval",
- "EntityList",
+ "EntityManualTriggerRequestBody",
"EntityMapping",
- "EntityQuery",
- "EntityQueryItem",
- "EntityQueryItemProperties",
- "EntityQueryItemPropertiesDataTypesItem",
- "EntityQueryList",
- "EntityQueryTemplate",
- "EntityQueryTemplateList",
- "EntityTimelineItem",
- "EntityTimelineParameters",
- "EntityTimelineResponse",
+ "ErrorAdditionalInfo",
+ "ErrorDetail",
+ "ErrorResponse",
"EventGroupingSettings",
- "ExpansionEntityQuery",
- "ExpansionResultAggregation",
- "ExpansionResultsMetadata",
- "EyesOn",
"FieldMapping",
"FileEntity",
"FileEntityProperties",
"FileHashEntity",
"FileHashEntityProperties",
- "FileImport",
- "FileImportList",
- "FileMetadata",
"FusionAlertRule",
"FusionAlertRuleTemplate",
- "FusionScenarioExclusionPattern",
- "FusionSourceSettings",
- "FusionSourceSubTypeSetting",
- "FusionSubTypeSeverityFilter",
- "FusionSubTypeSeverityFiltersItem",
- "FusionTemplateSourceSetting",
- "FusionTemplateSourceSubType",
- "FusionTemplateSubTypeSeverityFilter",
+ "GCPAuthModel",
+ "GenericBlobSbsAuthModel",
"GeoLocation",
- "GetInsightsErrorKind",
- "GetInsightsResultsMetadata",
- "GetQueriesResponse",
+ "GitHubAuthModel",
"GitHubResourceInfo",
- "GraphQueries",
+ "GraphQuery",
"GroupingConfiguration",
"HostEntity",
"HostEntityProperties",
@@ -702,52 +477,20 @@
"IncidentPropertiesAction",
"IncidentTask",
"IncidentTaskList",
- "InsightQueryItem",
- "InsightQueryItemProperties",
- "InsightQueryItemPropertiesAdditionalQuery",
- "InsightQueryItemPropertiesDefaultTimeRange",
- "InsightQueryItemPropertiesReferenceTimeRange",
- "InsightQueryItemPropertiesTableQuery",
- "InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem",
- "InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem",
- "InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem",
- "InsightsTableResult",
- "InsightsTableResultColumnsItem",
- "InstructionSteps",
- "InstructionStepsInstructionsItem",
- "Instructions",
- "IoTCheckRequirements",
- "IoTDataConnector",
- "IoTDataConnectorProperties",
+ "InstructionStep",
+ "InstructionStepDetails",
"IoTDeviceEntity",
"IoTDeviceEntityProperties",
"IpEntity",
"IpEntityProperties",
- "LastDataReceivedDataType",
- "MCASCheckRequirements",
- "MCASCheckRequirementsProperties",
+ "JwtAuthModel",
"MCASDataConnector",
"MCASDataConnectorDataTypes",
- "MCASDataConnectorProperties",
- "MDATPCheckRequirements",
- "MDATPCheckRequirementsProperties",
"MDATPDataConnector",
- "MDATPDataConnectorProperties",
- "MLBehaviorAnalyticsAlertRule",
- "MLBehaviorAnalyticsAlertRuleTemplate",
- "MLBehaviorAnalyticsAlertRuleTemplateProperties",
- "MSTICheckRequirements",
- "MSTICheckRequirementsProperties",
"MSTIDataConnector",
"MSTIDataConnectorDataTypes",
- "MSTIDataConnectorDataTypesBingSafetyPhishingURL",
"MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
"MSTIDataConnectorProperties",
- "MTPCheckRequirementsProperties",
- "MTPDataConnector",
- "MTPDataConnectorDataTypes",
- "MTPDataConnectorDataTypesIncidents",
- "MTPDataConnectorProperties",
"MailClusterEntity",
"MailClusterEntityProperties",
"MailMessageEntity",
@@ -769,59 +512,41 @@
"MicrosoftSecurityIncidentCreationAlertRuleCommonProperties",
"MicrosoftSecurityIncidentCreationAlertRuleProperties",
"MicrosoftSecurityIncidentCreationAlertRuleTemplate",
- "MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties",
- "MtpCheckRequirements",
- "NicEntity",
- "NicEntityProperties",
- "NrtAlertRule",
- "NrtAlertRuleTemplate",
- "NrtAlertRuleTemplateProperties",
- "Office365ProjectCheckRequirements",
- "Office365ProjectCheckRequirementsProperties",
- "Office365ProjectConnectorDataTypes",
- "Office365ProjectConnectorDataTypesLogs",
- "Office365ProjectDataConnector",
- "Office365ProjectDataConnectorProperties",
- "OfficeATPCheckRequirements",
- "OfficeATPCheckRequirementsProperties",
- "OfficeATPDataConnector",
- "OfficeATPDataConnectorProperties",
- "OfficeConsent",
- "OfficeConsentList",
+ "NoneAuthModel",
+ "OAuthModel",
"OfficeDataConnector",
"OfficeDataConnectorDataTypes",
"OfficeDataConnectorDataTypesExchange",
"OfficeDataConnectorDataTypesSharePoint",
"OfficeDataConnectorDataTypesTeams",
- "OfficeDataConnectorProperties",
- "OfficeIRMCheckRequirements",
- "OfficeIRMCheckRequirementsProperties",
- "OfficeIRMDataConnector",
- "OfficeIRMDataConnectorProperties",
- "OfficePowerBICheckRequirements",
- "OfficePowerBICheckRequirementsProperties",
- "OfficePowerBIConnectorDataTypes",
- "OfficePowerBIConnectorDataTypesLogs",
- "OfficePowerBIDataConnector",
- "OfficePowerBIDataConnectorProperties",
"Operation",
"OperationDisplay",
"OperationsList",
- "Permissions",
- "PermissionsCustomsItem",
- "PermissionsResourceProviderItem",
+ "OracleAuthModel",
+ "PackageBaseProperties",
+ "PackageList",
+ "PackageModel",
+ "PackageProperties",
"PlaybookActionProperties",
+ "PremiumMdtiDataConnectorDataTypes",
+ "PremiumMdtiDataConnectorDataTypesConnector",
+ "PremiumMdtiDataConnectorProperties",
+ "PremiumMicrosoftDefenderForThreatIntelligence",
"ProcessEntity",
"ProcessEntityProperties",
+ "ProductPackageAdditionalProperties",
+ "ProductPackageList",
+ "ProductPackageModel",
+ "ProductPackageProperties",
+ "ProductTemplateAdditionalProperties",
+ "ProductTemplateList",
+ "ProductTemplateModel",
+ "ProductTemplateProperties",
"PropertyArrayChangedConditionProperties",
"PropertyArrayConditionProperties",
"PropertyChangedConditionProperties",
"PropertyConditionProperties",
- "QueryBasedAlertRuleTemplateProperties",
- "Recommendation",
- "RecommendationList",
- "RecommendationPatch",
- "RecommendedAction",
+ "PullRequest",
"RegistryKeyEntity",
"RegistryKeyEntityProperties",
"RegistryValueEntity",
@@ -831,12 +556,20 @@
"Repo",
"RepoList",
"Repository",
+ "RepositoryAccess",
+ "RepositoryAccessProperties",
"RepositoryResourceInfo",
- "RequiredPermissions",
"Resource",
- "ResourceProvider",
+ "ResourceProviderRequiredPermissions",
"ResourceWithEtag",
- "SampleQueries",
+ "RestApiPollerDataConnector",
+ "RestApiPollerRequestConfig",
+ "RestApiPollerRequestPagingConfig",
+ "RestApiPollerRequestPagingCountBaseConfig",
+ "RestApiPollerRequestPagingLinkHeaderConfig",
+ "RestApiPollerRequestPagingNextPageUrlConfig",
+ "RestApiPollerRequestPagingOffsetConfig",
+ "RestApiPollerRequestPagingTokenConfig",
"ScheduledAlertRule",
"ScheduledAlertRuleCommonProperties",
"ScheduledAlertRuleProperties",
@@ -844,34 +577,29 @@
"SecurityAlert",
"SecurityAlertProperties",
"SecurityAlertPropertiesConfidenceReasonsItem",
- "SecurityAlertTimelineItem",
"SecurityGroupEntity",
"SecurityGroupEntityProperties",
"SecurityMLAnalyticsSetting",
"SecurityMLAnalyticsSettingsDataSource",
"SecurityMLAnalyticsSettingsList",
- "SentinelEntityMapping",
"SentinelOnboardingState",
"SentinelOnboardingStatesList",
- "SettingList",
- "Settings",
+ "ServicePrincipal",
+ "SessionAuthModel",
"SourceControl",
"SourceControlList",
"SubmissionMailEntity",
"SubmissionMailEntityProperties",
"SystemData",
- "TICheckRequirements",
- "TICheckRequirementsProperties",
"TIDataConnector",
"TIDataConnectorDataTypes",
"TIDataConnectorDataTypesIndicators",
- "TIDataConnectorProperties",
- "TeamInformation",
- "TeamProperties",
+ "TemplateAdditionalProperties",
+ "TemplateBaseProperties",
+ "TemplateList",
+ "TemplateModel",
+ "TemplateProperties",
"ThreatIntelligence",
- "ThreatIntelligenceAlertRule",
- "ThreatIntelligenceAlertRuleTemplate",
- "ThreatIntelligenceAlertRuleTemplateProperties",
"ThreatIntelligenceAppendTags",
"ThreatIntelligenceExternalReference",
"ThreatIntelligenceFilteringCriteria",
@@ -888,20 +616,11 @@
"ThreatIntelligenceParsedPattern",
"ThreatIntelligenceParsedPatternTypeValue",
"ThreatIntelligenceSortingCriteria",
- "TiTaxiiCheckRequirements",
- "TiTaxiiCheckRequirementsProperties",
- "TiTaxiiDataConnector",
- "TiTaxiiDataConnectorDataTypes",
- "TiTaxiiDataConnectorDataTypesTaxiiClient",
- "TiTaxiiDataConnectorProperties",
- "TimelineAggregation",
- "TimelineError",
- "TimelineResultsMetadata",
- "Ueba",
"UrlEntity",
"UrlEntityProperties",
"UserInfo",
- "ValidationError",
+ "Warning",
+ "WarningBody",
"Watchlist",
"WatchlistItem",
"WatchlistItemList",
@@ -924,82 +643,62 @@
"AutomationRulePropertyChangedConditionSupportedPropertyType",
"AutomationRulePropertyConditionSupportedOperator",
"AutomationRulePropertyConditionSupportedProperty",
- "Category",
+ "CcpAuthType",
"ConditionType",
"ConfidenceLevel",
"ConfidenceScoreStatus",
- "ConnectAuthKind",
- "ConnectivityType",
"ContentType",
- "Context",
"CreatedByType",
- "CustomEntityQueryKind",
- "DataConnectorAuthorizationState",
+ "DataConnectorDefinitionKind",
"DataConnectorKind",
- "DataConnectorLicenseState",
"DataTypeState",
- "DeleteStatus",
"DeliveryAction",
"DeliveryLocation",
"DeploymentFetchStatus",
"DeploymentResult",
"DeploymentState",
- "DeviceImportance",
"ElevationToken",
- "EntityItemQueryKind",
- "EntityKind",
+ "EntityKindEnum",
"EntityMappingType",
- "EntityProviders",
- "EntityQueryKind",
- "EntityQueryTemplateKind",
- "EntityTimelineKind",
- "EntityType",
- "Enum13",
- "Enum15",
"EventGroupingAggregationKind",
- "FileFormat",
"FileHashAlgorithm",
- "FileImportContentType",
- "FileImportState",
- "GetInsightsError",
+ "Flag",
+ "HttpMethodVerb",
"IncidentClassification",
"IncidentClassificationReason",
"IncidentLabelType",
"IncidentSeverity",
"IncidentStatus",
"IncidentTaskStatus",
- "IngestionMode",
"KillChainIntent",
"Kind",
"MatchingMethod",
"MicrosoftSecurityProductName",
"OSFamily",
"Operator",
- "OutputType",
"OwnerType",
- "PermissionProviderScope",
- "PollingFrequency",
- "Priority",
- "ProviderName",
+ "PackageKind",
+ "ProviderPermissionsScope",
+ "ProvisioningState",
"RegistryHive",
"RegistryValueKind",
"RepoType",
+ "RepositoryAccessKind",
+ "RestApiPollerRequestPagingKind",
"SecurityMLAnalyticsSettingsKind",
- "SettingKind",
- "SettingType",
"SettingsStatus",
"SourceKind",
"SourceType",
"State",
"SupportTier",
"TemplateStatus",
- "ThreatIntelligenceResourceKindEnum",
- "ThreatIntelligenceSortingCriteriaEnum",
+ "ThreatIntelligenceResourceInnerKind",
+ "ThreatIntelligenceSortingOrder",
"TriggerOperator",
"TriggersOn",
"TriggersWhen",
- "UebaDataSources",
"Version",
+ "WarningCode",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_models_py3.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_models_py3.py
index 5a15e9c34571..1f4438e3bd1c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_models_py3.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# 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.
@@ -16,171 +16,20 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
-class DataConnectorsCheckRequirements(_serialization.Model):
- """Data connector requirements properties.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AwsCloudTrailCheckRequirements, AwsS3CheckRequirements, AADCheckRequirements,
- AATPCheckRequirements, ASCCheckRequirements, Dynamics365CheckRequirements,
- IoTCheckRequirements, MCASCheckRequirements, MDATPCheckRequirements, MSTICheckRequirements,
- MtpCheckRequirements, Office365ProjectCheckRequirements, OfficeATPCheckRequirements,
- OfficeIRMCheckRequirements, OfficePowerBICheckRequirements, TICheckRequirements,
- TiTaxiiCheckRequirements
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- }
-
- _subtype_map = {
- "kind": {
- "AmazonWebServicesCloudTrail": "AwsCloudTrailCheckRequirements",
- "AmazonWebServicesS3": "AwsS3CheckRequirements",
- "AzureActiveDirectory": "AADCheckRequirements",
- "AzureAdvancedThreatProtection": "AATPCheckRequirements",
- "AzureSecurityCenter": "ASCCheckRequirements",
- "Dynamics365": "Dynamics365CheckRequirements",
- "IOT": "IoTCheckRequirements",
- "MicrosoftCloudAppSecurity": "MCASCheckRequirements",
- "MicrosoftDefenderAdvancedThreatProtection": "MDATPCheckRequirements",
- "MicrosoftThreatIntelligence": "MSTICheckRequirements",
- "MicrosoftThreatProtection": "MtpCheckRequirements",
- "Office365Project": "Office365ProjectCheckRequirements",
- "OfficeATP": "OfficeATPCheckRequirements",
- "OfficeIRM": "OfficeIRMCheckRequirements",
- "OfficePowerBI": "OfficePowerBICheckRequirements",
- "ThreatIntelligence": "TICheckRequirements",
- "ThreatIntelligenceTaxii": "TiTaxiiCheckRequirements",
- }
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: Optional[str] = None
-
-
-class AADCheckRequirements(DataConnectorsCheckRequirements):
- """Represents AAD (Azure Active Directory) requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "AzureActiveDirectory"
- self.tenant_id = tenant_id
-
-
-class DataConnectorTenantId(_serialization.Model):
- """Properties data connector on tenant level.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.tenant_id = tenant_id
-
-
-class AADCheckRequirementsProperties(DataConnectorTenantId):
- """AAD (Azure Active Directory) requirements check properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
-
-
class Resource(_serialization.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -206,7 +55,7 @@ class Resource(_serialization.Model):
"system_data": {"key": "systemData", "type": "SystemData"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.id = None
@@ -220,8 +69,8 @@ class ResourceWithEtag(Resource):
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -250,7 +99,7 @@ class ResourceWithEtag(Resource):
"etag": {"key": "etag", "type": "str"},
}
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -263,19 +112,16 @@ class DataConnector(ResourceWithEtag):
"""Data connector.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- CodelessApiPollingDataConnector, AwsCloudTrailDataConnector, AwsS3DataConnector,
- AADDataConnector, AATPDataConnector, ASCDataConnector, Dynamics365DataConnector,
- CodelessUiDataConnector, IoTDataConnector, MCASDataConnector, MDATPDataConnector,
- MSTIDataConnector, MTPDataConnector, OfficeDataConnector, Office365ProjectDataConnector,
- OfficeATPDataConnector, OfficeIRMDataConnector, OfficePowerBIDataConnector, TIDataConnector,
- TiTaxiiDataConnector
+ AwsCloudTrailDataConnector, AADDataConnector, AATPDataConnector, ASCDataConnector,
+ MCASDataConnector, MDATPDataConnector, MSTIDataConnector, OfficeDataConnector,
+ PremiumMicrosoftDefenderForThreatIntelligence, RestApiPollerDataConnector, TIDataConnector
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -289,11 +135,9 @@ class DataConnector(ResourceWithEtag):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
"""
@@ -316,30 +160,21 @@ class DataConnector(ResourceWithEtag):
_subtype_map = {
"kind": {
- "APIPolling": "CodelessApiPollingDataConnector",
"AmazonWebServicesCloudTrail": "AwsCloudTrailDataConnector",
- "AmazonWebServicesS3": "AwsS3DataConnector",
"AzureActiveDirectory": "AADDataConnector",
"AzureAdvancedThreatProtection": "AATPDataConnector",
"AzureSecurityCenter": "ASCDataConnector",
- "Dynamics365": "Dynamics365DataConnector",
- "GenericUI": "CodelessUiDataConnector",
- "IOT": "IoTDataConnector",
"MicrosoftCloudAppSecurity": "MCASDataConnector",
"MicrosoftDefenderAdvancedThreatProtection": "MDATPDataConnector",
"MicrosoftThreatIntelligence": "MSTIDataConnector",
- "MicrosoftThreatProtection": "MTPDataConnector",
"Office365": "OfficeDataConnector",
- "Office365Project": "Office365ProjectDataConnector",
- "OfficeATP": "OfficeATPDataConnector",
- "OfficeIRM": "OfficeIRMDataConnector",
- "OfficePowerBI": "OfficePowerBIDataConnector",
+ "PremiumMicrosoftDefenderForThreatIntelligence": "PremiumMicrosoftDefenderForThreatIntelligence",
+ "RestApiPoller": "RestApiPollerDataConnector",
"ThreatIntelligence": "TIDataConnector",
- "ThreatIntelligenceTaxii": "TiTaxiiDataConnector",
}
}
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -353,10 +188,10 @@ class AADDataConnector(DataConnector):
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -370,11 +205,9 @@ class AADDataConnector(DataConnector):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
@@ -407,8 +240,8 @@ def __init__(
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -423,130 +256,15 @@ def __init__(
self.data_types = data_types
-class DataConnectorWithAlertsProperties(_serialization.Model):
- """Data connector properties.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- """
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- }
-
- def __init__(self, *, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- """
- super().__init__(**kwargs)
- self.data_types = data_types
-
-
-class AADDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """AAD (Azure Active Directory) data connector properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, data_types=data_types, **kwargs)
- self.data_types = data_types
- self.tenant_id = tenant_id
-
-
-class AATPCheckRequirements(DataConnectorsCheckRequirements):
- """Represents AATP (Azure Advanced Threat Protection) requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "AzureAdvancedThreatProtection"
- self.tenant_id = tenant_id
-
-
-class AATPCheckRequirementsProperties(DataConnectorTenantId):
- """AATP (Azure Advanced Threat Protection) requirements check properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
-
-
class AATPDataConnector(DataConnector):
"""Represents AATP (Azure Advanced Threat Protection) 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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -560,11 +278,9 @@ class AATPDataConnector(DataConnector):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
@@ -597,8 +313,8 @@ def __init__(
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -613,55 +329,21 @@ def __init__(
self.data_types = data_types
-class AATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """AATP (Azure Advanced Threat Protection) data connector properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, data_types=data_types, **kwargs)
- self.data_types = data_types
- self.tenant_id = tenant_id
-
-
class Entity(Resource):
"""Specific entity.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
AccountEntity, AzureResourceEntity, HuntingBookmark, CloudApplicationEntity, DnsEntity,
FileEntity, FileHashEntity, HostEntity, IoTDeviceEntity, IpEntity, MailClusterEntity,
- MailMessageEntity, MailboxEntity, MalwareEntity, NicEntity, ProcessEntity, RegistryKeyEntity,
+ MailMessageEntity, MailboxEntity, MalwareEntity, ProcessEntity, RegistryKeyEntity,
RegistryValueEntity, SecurityAlert, SecurityGroupEntity, SubmissionMailEntity, UrlEntity
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -674,8 +356,8 @@ class Entity(Resource):
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
"""
_validation = {
@@ -710,7 +392,6 @@ class Entity(Resource):
"MailMessage": "MailMessageEntity",
"Mailbox": "MailboxEntity",
"Malware": "MalwareEntity",
- "Nic": "NicEntity",
"Process": "ProcessEntity",
"RegistryKey": "RegistryKeyEntity",
"RegistryValue": "RegistryValueEntity",
@@ -721,21 +402,21 @@ class Entity(Resource):
}
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: Optional[str] = None
-class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
+class AccountEntity(Entity):
"""Represents an account entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -748,8 +429,8 @@ class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -770,7 +451,7 @@ class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
:vartype host_entity_id: str
:ivar is_domain_joined: Determines whether this is a domain account.
:vartype is_domain_joined: bool
- :ivar nt_domain: The NetBIOS domain name as it appears in the alert format - domain/username.
+ :ivar nt_domain: The NetBIOS domain name as it appears in the alert format - domain\\username.
Examples: NT AUTHORITY.
:vartype nt_domain: str
:ivar object_guid: The objectGUID attribute is a single-value attribute that is the unique
@@ -831,7 +512,7 @@ class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
"dns_domain": {"key": "properties.dnsDomain", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: str = "Account"
@@ -874,14 +555,14 @@ class EntityCommonProperties(_serialization.Model):
"friendly_name": {"key": "friendlyName", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.additional_data = None
self.friendly_name = None
-class AccountEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
+class AccountEntityProperties(EntityCommonProperties):
"""Account entity property bag.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -906,7 +587,7 @@ class AccountEntityProperties(EntityCommonProperties): # pylint: disable=too-ma
:vartype host_entity_id: str
:ivar is_domain_joined: Determines whether this is a domain account.
:vartype is_domain_joined: bool
- :ivar nt_domain: The NetBIOS domain name as it appears in the alert format - domain/username.
+ :ivar nt_domain: The NetBIOS domain name as it appears in the alert format - domain\\username.
Examples: NT AUTHORITY.
:vartype nt_domain: str
:ivar object_guid: The objectGUID attribute is a single-value attribute that is the unique
@@ -957,7 +638,7 @@ class AccountEntityProperties(EntityCommonProperties): # pylint: disable=too-ma
"dns_domain": {"key": "dnsDomain", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.aad_tenant_id = None
@@ -977,10 +658,10 @@ def __init__(self, **kwargs):
class ActionPropertiesBase(_serialization.Model):
"""Action property bag base.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
Required.
:vartype logic_app_resource_id: str
"""
@@ -993,10 +674,10 @@ class ActionPropertiesBase(_serialization.Model):
"logic_app_resource_id": {"key": "logicAppResourceId", "type": "str"},
}
- def __init__(self, *, logic_app_resource_id: str, **kwargs):
+ def __init__(self, *, logic_app_resource_id: str, **kwargs: Any) -> None:
"""
:keyword logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
Required.
:paramtype logic_app_resource_id: str
"""
@@ -1009,8 +690,8 @@ class ActionRequest(ResourceWithEtag):
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -1023,7 +704,7 @@ class ActionRequest(ResourceWithEtag):
:ivar etag: Etag of the azure resource.
:vartype etag: str
:ivar logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
:vartype logic_app_resource_id: str
:ivar trigger_uri: Logic App Callback URL for this specific workflow.
:vartype trigger_uri: str
@@ -1052,13 +733,13 @@ def __init__(
etag: Optional[str] = None,
logic_app_resource_id: Optional[str] = None,
trigger_uri: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
:keyword logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
:paramtype logic_app_resource_id: str
:keyword trigger_uri: Logic App Callback URL for this specific workflow.
:paramtype trigger_uri: str
@@ -1071,10 +752,10 @@ def __init__(
class ActionRequestProperties(ActionPropertiesBase):
"""Action property bag.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
Required.
:vartype logic_app_resource_id: str
:ivar trigger_uri: Logic App Callback URL for this specific workflow. Required.
@@ -1091,10 +772,10 @@ class ActionRequestProperties(ActionPropertiesBase):
"trigger_uri": {"key": "triggerUri", "type": "str"},
}
- def __init__(self, *, logic_app_resource_id: str, trigger_uri: str, **kwargs):
+ def __init__(self, *, logic_app_resource_id: str, trigger_uri: str, **kwargs: Any) -> None:
"""
:keyword logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
Required.
:paramtype logic_app_resource_id: str
:keyword trigger_uri: Logic App Callback URL for this specific workflow. Required.
@@ -1104,13 +785,13 @@ def __init__(self, *, logic_app_resource_id: str, trigger_uri: str, **kwargs):
self.trigger_uri = trigger_uri
-class ActionResponse(ResourceWithEtag):
+class ActionResponse(Resource):
"""Action for alert rule.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -1120,10 +801,10 @@ class ActionResponse(ResourceWithEtag):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
+ :ivar etag: Etag of the action.
:vartype etag: str
:ivar logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
:vartype logic_app_resource_id: str
:ivar workflow_id: The name of the logic app's workflow.
:vartype workflow_id: str
@@ -1152,18 +833,19 @@ def __init__(
etag: Optional[str] = None,
logic_app_resource_id: Optional[str] = None,
workflow_id: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
+ :keyword etag: Etag of the action.
:paramtype etag: str
:keyword logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
:paramtype logic_app_resource_id: str
:keyword workflow_id: The name of the logic app's workflow.
:paramtype workflow_id: str
"""
- super().__init__(etag=etag, **kwargs)
+ super().__init__(**kwargs)
+ self.etag = etag
self.logic_app_resource_id = logic_app_resource_id
self.workflow_id = workflow_id
@@ -1171,10 +853,10 @@ def __init__(
class ActionResponseProperties(ActionPropertiesBase):
"""Action property bag.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
Required.
:vartype logic_app_resource_id: str
:ivar workflow_id: The name of the logic app's workflow.
@@ -1190,10 +872,10 @@ class ActionResponseProperties(ActionPropertiesBase):
"workflow_id": {"key": "workflowId", "type": "str"},
}
- def __init__(self, *, logic_app_resource_id: str, workflow_id: Optional[str] = None, **kwargs):
+ def __init__(self, *, logic_app_resource_id: str, workflow_id: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword logic_app_resource_id: Logic App Resource Id,
- /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
+ /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. # pylint: disable=line-too-long
Required.
:paramtype logic_app_resource_id: str
:keyword workflow_id: The name of the logic app's workflow.
@@ -1208,7 +890,7 @@ class ActionsList(_serialization.Model):
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.
+ All required parameters must be populated in order to send to server.
:ivar next_link: URL to fetch the next set of actions.
:vartype next_link: str
@@ -1226,7 +908,7 @@ class ActionsList(_serialization.Model):
"value": {"key": "value", "type": "[ActionResponse]"},
}
- def __init__(self, *, value: List["_models.ActionResponse"], **kwargs):
+ def __init__(self, *, value: List["_models.ActionResponse"], **kwargs: Any) -> None:
"""
:keyword value: Array of actions. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.ActionResponse]
@@ -1236,236 +918,145 @@ def __init__(self, *, value: List["_models.ActionResponse"], **kwargs):
self.value = value
-class CustomEntityQuery(ResourceWithEtag):
- """Specific entity query that supports put requests.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- ActivityCustomEntityQuery
-
- Variables are only populated by the server, and will be ignored when sending a request.
+class AddIncidentTaskActionProperties(_serialization.Model):
+ """Describes an automation rule action to add a task to an incident.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: the entity query kind. Required. "Activity"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.CustomEntityQueryKind
+ :ivar title: The title of the task. Required.
+ :vartype title: str
+ :ivar description: The description of the task.
+ :vartype description: str
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ "title": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
+ "title": {"key": "title", "type": "str"},
+ "description": {"key": "description", "type": "str"},
}
- _subtype_map = {"kind": {"Activity": "ActivityCustomEntityQuery"}}
-
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(self, *, title: str, description: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
+ :keyword title: The title of the task. Required.
+ :paramtype title: str
+ :keyword description: The description of the task.
+ :paramtype description: str
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
-
-class ActivityCustomEntityQuery(CustomEntityQuery): # pylint: disable=too-many-instance-attributes
- """Represents Activity entity query.
+ super().__init__(**kwargs)
+ self.title = title
+ self.description = description
- 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.
+class AlertDetailsOverride(_serialization.Model):
+ """Settings for how to dynamically override alert static details.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: the entity query kind. Required. "Activity"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.CustomEntityQueryKind
- :ivar title: The entity query title.
- :vartype title: str
- :ivar content: The entity query content to display in timeline.
- :vartype content: str
- :ivar description: The entity query description.
- :vartype description: str
- :ivar query_definitions: The Activity query definitions.
- :vartype query_definitions:
- ~azure.mgmt.securityinsight.models.ActivityEntityQueriesPropertiesQueryDefinitions
- :ivar input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :vartype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :ivar required_input_fields_sets: List of the fields of the source entity that are required to
- run the query.
- :vartype required_input_fields_sets: list[list[str]]
- :ivar entities_filter: The query applied only to entities matching to all filters.
- :vartype entities_filter: dict[str, list[str]]
- :ivar template_name: The template id this activity was created from.
- :vartype template_name: str
- :ivar enabled: Determines whether this activity is enabled or disabled.
- :vartype enabled: bool
- :ivar created_time_utc: The time the activity was created.
- :vartype created_time_utc: ~datetime.datetime
- :ivar last_modified_time_utc: The last time the activity was updated.
- :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar alert_display_name_format: the format containing columns name(s) to override the alert
+ name.
+ :vartype alert_display_name_format: str
+ :ivar alert_description_format: the format containing columns name(s) to override the alert
+ description.
+ :vartype alert_description_format: str
+ :ivar alert_tactics_column_name: the column name to take the alert tactics from.
+ :vartype alert_tactics_column_name: str
+ :ivar alert_severity_column_name: the column name to take the alert severity from.
+ :vartype alert_severity_column_name: str
+ :ivar alert_dynamic_properties: List of additional dynamic properties to override.
+ :vartype alert_dynamic_properties:
+ list[~azure.mgmt.securityinsight.models.AlertPropertyMapping]
"""
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "created_time_utc": {"readonly": True},
- "last_modified_time_utc": {"readonly": True},
- }
-
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "title": {"key": "properties.title", "type": "str"},
- "content": {"key": "properties.content", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "query_definitions": {
- "key": "properties.queryDefinitions",
- "type": "ActivityEntityQueriesPropertiesQueryDefinitions",
- },
- "input_entity_type": {"key": "properties.inputEntityType", "type": "str"},
- "required_input_fields_sets": {"key": "properties.requiredInputFieldsSets", "type": "[[str]]"},
- "entities_filter": {"key": "properties.entitiesFilter", "type": "{[str]}"},
- "template_name": {"key": "properties.templateName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
- "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "alert_display_name_format": {"key": "alertDisplayNameFormat", "type": "str"},
+ "alert_description_format": {"key": "alertDescriptionFormat", "type": "str"},
+ "alert_tactics_column_name": {"key": "alertTacticsColumnName", "type": "str"},
+ "alert_severity_column_name": {"key": "alertSeverityColumnName", "type": "str"},
+ "alert_dynamic_properties": {"key": "alertDynamicProperties", "type": "[AlertPropertyMapping]"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- title: Optional[str] = None,
- content: Optional[str] = None,
- description: Optional[str] = None,
- query_definitions: Optional["_models.ActivityEntityQueriesPropertiesQueryDefinitions"] = None,
- input_entity_type: Optional[Union[str, "_models.EntityType"]] = None,
- required_input_fields_sets: Optional[List[List[str]]] = None,
- entities_filter: Optional[Dict[str, List[str]]] = None,
- template_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- **kwargs
- ):
+ alert_display_name_format: Optional[str] = None,
+ alert_description_format: Optional[str] = None,
+ alert_tactics_column_name: Optional[str] = None,
+ alert_severity_column_name: Optional[str] = None,
+ alert_dynamic_properties: Optional[List["_models.AlertPropertyMapping"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword title: The entity query title.
- :paramtype title: str
- :keyword content: The entity query content to display in timeline.
- :paramtype content: str
- :keyword description: The entity query description.
- :paramtype description: str
- :keyword query_definitions: The Activity query definitions.
- :paramtype query_definitions:
- ~azure.mgmt.securityinsight.models.ActivityEntityQueriesPropertiesQueryDefinitions
- :keyword input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :paramtype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :keyword required_input_fields_sets: List of the fields of the source entity that are required
- to run the query.
- :paramtype required_input_fields_sets: list[list[str]]
- :keyword entities_filter: The query applied only to entities matching to all filters.
- :paramtype entities_filter: dict[str, list[str]]
- :keyword template_name: The template id this activity was created from.
- :paramtype template_name: str
- :keyword enabled: Determines whether this activity is enabled or disabled.
- :paramtype enabled: bool
+ :keyword alert_display_name_format: the format containing columns name(s) to override the alert
+ name.
+ :paramtype alert_display_name_format: str
+ :keyword alert_description_format: the format containing columns name(s) to override the alert
+ description.
+ :paramtype alert_description_format: str
+ :keyword alert_tactics_column_name: the column name to take the alert tactics from.
+ :paramtype alert_tactics_column_name: str
+ :keyword alert_severity_column_name: the column name to take the alert severity from.
+ :paramtype alert_severity_column_name: str
+ :keyword alert_dynamic_properties: List of additional dynamic properties to override.
+ :paramtype alert_dynamic_properties:
+ list[~azure.mgmt.securityinsight.models.AlertPropertyMapping]
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Activity"
- self.title = title
- self.content = content
- self.description = description
- self.query_definitions = query_definitions
- self.input_entity_type = input_entity_type
- self.required_input_fields_sets = required_input_fields_sets
- self.entities_filter = entities_filter
- self.template_name = template_name
- self.enabled = enabled
- self.created_time_utc = None
- self.last_modified_time_utc = None
+ super().__init__(**kwargs)
+ self.alert_display_name_format = alert_display_name_format
+ self.alert_description_format = alert_description_format
+ self.alert_tactics_column_name = alert_tactics_column_name
+ self.alert_severity_column_name = alert_severity_column_name
+ self.alert_dynamic_properties = alert_dynamic_properties
-class ActivityEntityQueriesPropertiesQueryDefinitions(_serialization.Model):
- """The Activity query definitions.
+class AlertPropertyMapping(_serialization.Model):
+ """A single alert property mapping to override.
- :ivar query: The Activity query to run on a given entity.
- :vartype query: str
+ :ivar alert_property: The V3 alert property. Known values are: "AlertLink", "ConfidenceLevel",
+ "ConfidenceScore", "ExtendedLinks", "ProductName", "ProviderName", "ProductComponentName",
+ "RemediationSteps", and "Techniques".
+ :vartype alert_property: str or ~azure.mgmt.securityinsight.models.AlertProperty
+ :ivar value: the column name to use to override this property.
+ :vartype value: str
"""
_attribute_map = {
- "query": {"key": "query", "type": "str"},
+ "alert_property": {"key": "alertProperty", "type": "str"},
+ "value": {"key": "value", "type": "str"},
}
- def __init__(self, *, query: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ alert_property: Optional[Union[str, "_models.AlertProperty"]] = None,
+ value: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword query: The Activity query to run on a given entity.
- :paramtype query: str
+ :keyword alert_property: The V3 alert property. Known values are: "AlertLink",
+ "ConfidenceLevel", "ConfidenceScore", "ExtendedLinks", "ProductName", "ProviderName",
+ "ProductComponentName", "RemediationSteps", and "Techniques".
+ :paramtype alert_property: str or ~azure.mgmt.securityinsight.models.AlertProperty
+ :keyword value: the column name to use to override this property.
+ :paramtype value: str
"""
super().__init__(**kwargs)
- self.query = query
+ self.alert_property = alert_property
+ self.value = value
-class EntityQuery(ResourceWithEtag):
- """Specific entity query.
+class AlertRule(ResourceWithEtag):
+ """Alert rule.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- ActivityEntityQuery, ExpansionEntityQuery
+ FusionAlertRule, MicrosoftSecurityIncidentCreationAlertRule, ScheduledAlertRule
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -1477,9 +1068,9 @@ class EntityQuery(ResourceWithEtag):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: the entity query kind. Required. Known values are: "Expansion", "Insight", and
- "Activity".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryKind
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
"""
_validation = {
@@ -1499,9 +1090,15 @@ class EntityQuery(ResourceWithEtag):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"Activity": "ActivityEntityQuery", "Expansion": "ExpansionEntityQuery"}}
+ _subtype_map = {
+ "kind": {
+ "Fusion": "FusionAlertRule",
+ "MicrosoftSecurityIncidentCreation": "MicrosoftSecurityIncidentCreationAlertRule",
+ "Scheduled": "ScheduledAlertRule",
+ }
+ }
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -1510,162 +1107,52 @@ def __init__(self, *, etag: Optional[str] = None, **kwargs):
self.kind: Optional[str] = None
-class ActivityEntityQuery(EntityQuery): # pylint: disable=too-many-instance-attributes
- """Represents Activity entity query.
+class AlertRulesList(_serialization.Model):
+ """List all the alert rules.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: the entity query kind. Required. Known values are: "Expansion", "Insight", and
- "Activity".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryKind
- :ivar title: The entity query title.
- :vartype title: str
- :ivar content: The entity query content to display in timeline.
- :vartype content: str
- :ivar description: The entity query description.
- :vartype description: str
- :ivar query_definitions: The Activity query definitions.
- :vartype query_definitions:
- ~azure.mgmt.securityinsight.models.ActivityEntityQueriesPropertiesQueryDefinitions
- :ivar input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :vartype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :ivar required_input_fields_sets: List of the fields of the source entity that are required to
- run the query.
- :vartype required_input_fields_sets: list[list[str]]
- :ivar entities_filter: The query applied only to entities matching to all filters.
- :vartype entities_filter: dict[str, list[str]]
- :ivar template_name: The template id this activity was created from.
- :vartype template_name: str
- :ivar enabled: Determines whether this activity is enabled or disabled.
- :vartype enabled: bool
- :ivar created_time_utc: The time the activity was created.
- :vartype created_time_utc: ~datetime.datetime
- :ivar last_modified_time_utc: The last time the activity was updated.
- :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar next_link: URL to fetch the next set of alert rules.
+ :vartype next_link: str
+ :ivar value: Array of alert rules. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.AlertRule]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "created_time_utc": {"readonly": True},
- "last_modified_time_utc": {"readonly": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "title": {"key": "properties.title", "type": "str"},
- "content": {"key": "properties.content", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "query_definitions": {
- "key": "properties.queryDefinitions",
- "type": "ActivityEntityQueriesPropertiesQueryDefinitions",
- },
- "input_entity_type": {"key": "properties.inputEntityType", "type": "str"},
- "required_input_fields_sets": {"key": "properties.requiredInputFieldsSets", "type": "[[str]]"},
- "entities_filter": {"key": "properties.entitiesFilter", "type": "{[str]}"},
- "template_name": {"key": "properties.templateName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
- "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[AlertRule]"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- title: Optional[str] = None,
- content: Optional[str] = None,
- description: Optional[str] = None,
- query_definitions: Optional["_models.ActivityEntityQueriesPropertiesQueryDefinitions"] = None,
- input_entity_type: Optional[Union[str, "_models.EntityType"]] = None,
- required_input_fields_sets: Optional[List[List[str]]] = None,
- entities_filter: Optional[Dict[str, List[str]]] = None,
- template_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- **kwargs
- ):
+ def __init__(self, *, value: List["_models.AlertRule"], **kwargs: Any) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword title: The entity query title.
- :paramtype title: str
- :keyword content: The entity query content to display in timeline.
- :paramtype content: str
- :keyword description: The entity query description.
- :paramtype description: str
- :keyword query_definitions: The Activity query definitions.
- :paramtype query_definitions:
- ~azure.mgmt.securityinsight.models.ActivityEntityQueriesPropertiesQueryDefinitions
- :keyword input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :paramtype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :keyword required_input_fields_sets: List of the fields of the source entity that are required
- to run the query.
- :paramtype required_input_fields_sets: list[list[str]]
- :keyword entities_filter: The query applied only to entities matching to all filters.
- :paramtype entities_filter: dict[str, list[str]]
- :keyword template_name: The template id this activity was created from.
- :paramtype template_name: str
- :keyword enabled: Determines whether this activity is enabled or disabled.
- :paramtype enabled: bool
+ :keyword value: Array of alert rules. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.AlertRule]
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Activity"
- self.title = title
- self.content = content
- self.description = description
- self.query_definitions = query_definitions
- self.input_entity_type = input_entity_type
- self.required_input_fields_sets = required_input_fields_sets
- self.entities_filter = entities_filter
- self.template_name = template_name
- self.enabled = enabled
- self.created_time_utc = None
- self.last_modified_time_utc = None
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class EntityQueryTemplate(Resource):
- """Specific entity query template.
+class AlertRuleTemplate(Resource):
+ """Alert rule template.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- ActivityEntityQueryTemplate
+ FusionAlertRuleTemplate, MicrosoftSecurityIncidentCreationAlertRuleTemplate,
+ ScheduledAlertRuleTemplate
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -1675,8 +1162,9 @@ class EntityQueryTemplate(Resource):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: the entity query template kind. Required. "Activity"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
"""
_validation = {
@@ -1695,425 +1183,113 @@ class EntityQueryTemplate(Resource):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"Activity": "ActivityEntityQueryTemplate"}}
+ _subtype_map = {
+ "kind": {
+ "Fusion": "FusionAlertRuleTemplate",
+ "MicrosoftSecurityIncidentCreation": "MicrosoftSecurityIncidentCreationAlertRuleTemplate",
+ "Scheduled": "ScheduledAlertRuleTemplate",
+ }
+ }
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: Optional[str] = None
-class ActivityEntityQueryTemplate(EntityQueryTemplate): # pylint: disable=too-many-instance-attributes
- """Represents Activity entity query.
-
- 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.
+class AlertRuleTemplateDataSource(_serialization.Model):
+ """alert rule template data sources.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: the entity query template kind. Required. "Activity"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
- :ivar title: The entity query title.
- :vartype title: str
- :ivar content: The entity query content to display in timeline.
- :vartype content: str
- :ivar description: The entity query description.
- :vartype description: str
- :ivar query_definitions: The Activity query definitions.
- :vartype query_definitions:
- ~azure.mgmt.securityinsight.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions
- :ivar data_types: List of required data types for the given entity query template.
- :vartype data_types: list[~azure.mgmt.securityinsight.models.DataTypeDefinitions]
- :ivar input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :vartype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :ivar required_input_fields_sets: List of the fields of the source entity that are required to
- run the query.
- :vartype required_input_fields_sets: list[list[str]]
- :ivar entities_filter: The query applied only to entities matching to all filters.
- :vartype entities_filter: dict[str, list[str]]
+ :ivar connector_id: The connector id that provides the following data types.
+ :vartype connector_id: str
+ :ivar data_types: The data types used by the alert rule template.
+ :vartype data_types: list[str]
"""
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "title": {"key": "properties.title", "type": "str"},
- "content": {"key": "properties.content", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "query_definitions": {
- "key": "properties.queryDefinitions",
- "type": "ActivityEntityQueryTemplatePropertiesQueryDefinitions",
- },
- "data_types": {"key": "properties.dataTypes", "type": "[DataTypeDefinitions]"},
- "input_entity_type": {"key": "properties.inputEntityType", "type": "str"},
- "required_input_fields_sets": {"key": "properties.requiredInputFieldsSets", "type": "[[str]]"},
- "entities_filter": {"key": "properties.entitiesFilter", "type": "{[str]}"},
+ "connector_id": {"key": "connectorId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "[str]"},
}
def __init__(
- self,
- *,
- title: Optional[str] = None,
- content: Optional[str] = None,
- description: Optional[str] = None,
- query_definitions: Optional["_models.ActivityEntityQueryTemplatePropertiesQueryDefinitions"] = None,
- data_types: Optional[List["_models.DataTypeDefinitions"]] = None,
- input_entity_type: Optional[Union[str, "_models.EntityType"]] = None,
- required_input_fields_sets: Optional[List[List[str]]] = None,
- entities_filter: Optional[Dict[str, List[str]]] = None,
- **kwargs
- ):
- """
- :keyword title: The entity query title.
- :paramtype title: str
- :keyword content: The entity query content to display in timeline.
- :paramtype content: str
- :keyword description: The entity query description.
- :paramtype description: str
- :keyword query_definitions: The Activity query definitions.
- :paramtype query_definitions:
- ~azure.mgmt.securityinsight.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions
- :keyword data_types: List of required data types for the given entity query template.
- :paramtype data_types: list[~azure.mgmt.securityinsight.models.DataTypeDefinitions]
- :keyword input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :paramtype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :keyword required_input_fields_sets: List of the fields of the source entity that are required
- to run the query.
- :paramtype required_input_fields_sets: list[list[str]]
- :keyword entities_filter: The query applied only to entities matching to all filters.
- :paramtype entities_filter: dict[str, list[str]]
- """
- super().__init__(**kwargs)
- self.kind: str = "Activity"
- self.title = title
- self.content = content
- self.description = description
- self.query_definitions = query_definitions
- self.data_types = data_types
- self.input_entity_type = input_entity_type
- self.required_input_fields_sets = required_input_fields_sets
- self.entities_filter = entities_filter
-
-
-class ActivityEntityQueryTemplatePropertiesQueryDefinitions(_serialization.Model):
- """The Activity query definitions.
-
- :ivar query: The Activity query to run on a given entity.
- :vartype query: str
- :ivar summarize_by: The dimensions we want to summarize the timeline results on, this is comma
- separated list.
- :vartype summarize_by: str
- """
-
- _attribute_map = {
- "query": {"key": "query", "type": "str"},
- "summarize_by": {"key": "summarizeBy", "type": "str"},
- }
-
- def __init__(self, *, query: Optional[str] = None, summarize_by: Optional[str] = None, **kwargs):
+ self, *, connector_id: Optional[str] = None, data_types: Optional[List[str]] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword query: The Activity query to run on a given entity.
- :paramtype query: str
- :keyword summarize_by: The dimensions we want to summarize the timeline results on, this is
- comma separated list.
- :paramtype summarize_by: str
+ :keyword connector_id: The connector id that provides the following data types.
+ :paramtype connector_id: str
+ :keyword data_types: The data types used by the alert rule template.
+ :paramtype data_types: list[str]
"""
super().__init__(**kwargs)
- self.query = query
- self.summarize_by = summarize_by
-
-
-class EntityTimelineItem(_serialization.Model):
- """Entity timeline Item.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- ActivityTimelineItem, AnomalyTimelineItem, BookmarkTimelineItem, SecurityAlertTimelineItem
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: The entity query kind type. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- }
-
- _subtype_map = {
- "kind": {
- "Activity": "ActivityTimelineItem",
- "Anomaly": "AnomalyTimelineItem",
- "Bookmark": "BookmarkTimelineItem",
- "SecurityAlert": "SecurityAlertTimelineItem",
- }
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: Optional[str] = None
-
-
-class ActivityTimelineItem(EntityTimelineItem):
- """Represents Activity timeline item.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: The entity query kind type. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- :ivar query_id: The activity query id. Required.
- :vartype query_id: str
- :ivar bucket_start_time_utc: The grouping bucket start time. Required.
- :vartype bucket_start_time_utc: ~datetime.datetime
- :ivar bucket_end_time_utc: The grouping bucket end time. Required.
- :vartype bucket_end_time_utc: ~datetime.datetime
- :ivar first_activity_time_utc: The time of the first activity in the grouping bucket. Required.
- :vartype first_activity_time_utc: ~datetime.datetime
- :ivar last_activity_time_utc: The time of the last activity in the grouping bucket. Required.
- :vartype last_activity_time_utc: ~datetime.datetime
- :ivar content: The activity timeline content. Required.
- :vartype content: str
- :ivar title: The activity timeline title. Required.
- :vartype title: str
- """
-
- _validation = {
- "kind": {"required": True},
- "query_id": {"required": True},
- "bucket_start_time_utc": {"required": True},
- "bucket_end_time_utc": {"required": True},
- "first_activity_time_utc": {"required": True},
- "last_activity_time_utc": {"required": True},
- "content": {"required": True},
- "title": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "query_id": {"key": "queryId", "type": "str"},
- "bucket_start_time_utc": {"key": "bucketStartTimeUTC", "type": "iso-8601"},
- "bucket_end_time_utc": {"key": "bucketEndTimeUTC", "type": "iso-8601"},
- "first_activity_time_utc": {"key": "firstActivityTimeUTC", "type": "iso-8601"},
- "last_activity_time_utc": {"key": "lastActivityTimeUTC", "type": "iso-8601"},
- "content": {"key": "content", "type": "str"},
- "title": {"key": "title", "type": "str"},
- }
+ self.connector_id = connector_id
+ self.data_types = data_types
- def __init__(
- self,
- *,
- query_id: str,
- bucket_start_time_utc: datetime.datetime,
- bucket_end_time_utc: datetime.datetime,
- first_activity_time_utc: datetime.datetime,
- last_activity_time_utc: datetime.datetime,
- content: str,
- title: str,
- **kwargs
- ):
- """
- :keyword query_id: The activity query id. Required.
- :paramtype query_id: str
- :keyword bucket_start_time_utc: The grouping bucket start time. Required.
- :paramtype bucket_start_time_utc: ~datetime.datetime
- :keyword bucket_end_time_utc: The grouping bucket end time. Required.
- :paramtype bucket_end_time_utc: ~datetime.datetime
- :keyword first_activity_time_utc: The time of the first activity in the grouping bucket.
- Required.
- :paramtype first_activity_time_utc: ~datetime.datetime
- :keyword last_activity_time_utc: The time of the last activity in the grouping bucket.
- Required.
- :paramtype last_activity_time_utc: ~datetime.datetime
- :keyword content: The activity timeline content. Required.
- :paramtype content: str
- :keyword title: The activity timeline title. Required.
- :paramtype title: str
- """
- super().__init__(**kwargs)
- self.kind: str = "Activity"
- self.query_id = query_id
- self.bucket_start_time_utc = bucket_start_time_utc
- self.bucket_end_time_utc = bucket_end_time_utc
- self.first_activity_time_utc = first_activity_time_utc
- self.last_activity_time_utc = last_activity_time_utc
- self.content = content
- self.title = title
+class AlertRuleTemplatesList(_serialization.Model):
+ """List all the alert rule templates.
-class AddIncidentTaskActionProperties(_serialization.Model):
- """AddIncidentTaskActionProperties.
+ 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.
+ All required parameters must be populated in order to send to server.
- :ivar title: The title of the task. Required.
- :vartype title: str
- :ivar description: The description of the task.
- :vartype description: str
+ :ivar next_link: URL to fetch the next set of alert rule templates.
+ :vartype next_link: str
+ :ivar value: Array of alert rule templates. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
"""
_validation = {
- "title": {"required": True},
- }
-
- _attribute_map = {
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
- def __init__(self, *, title: str, description: Optional[str] = None, **kwargs):
- """
- :keyword title: The title of the task. Required.
- :paramtype title: str
- :keyword description: The description of the task.
- :paramtype description: str
- """
- super().__init__(**kwargs)
- self.title = title
- self.description = description
-
-
-class AlertDetailsOverride(_serialization.Model):
- """Settings for how to dynamically override alert static details.
-
- :ivar alert_display_name_format: the format containing columns name(s) to override the alert
- name.
- :vartype alert_display_name_format: str
- :ivar alert_description_format: the format containing columns name(s) to override the alert
- description.
- :vartype alert_description_format: str
- :ivar alert_tactics_column_name: the column name to take the alert tactics from.
- :vartype alert_tactics_column_name: str
- :ivar alert_severity_column_name: the column name to take the alert severity from.
- :vartype alert_severity_column_name: str
- :ivar alert_dynamic_properties: List of additional dynamic properties to override.
- :vartype alert_dynamic_properties:
- list[~azure.mgmt.securityinsight.models.AlertPropertyMapping]
- """
-
_attribute_map = {
- "alert_display_name_format": {"key": "alertDisplayNameFormat", "type": "str"},
- "alert_description_format": {"key": "alertDescriptionFormat", "type": "str"},
- "alert_tactics_column_name": {"key": "alertTacticsColumnName", "type": "str"},
- "alert_severity_column_name": {"key": "alertSeverityColumnName", "type": "str"},
- "alert_dynamic_properties": {"key": "alertDynamicProperties", "type": "[AlertPropertyMapping]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[AlertRuleTemplate]"},
}
- def __init__(
- self,
- *,
- alert_display_name_format: Optional[str] = None,
- alert_description_format: Optional[str] = None,
- alert_tactics_column_name: Optional[str] = None,
- alert_severity_column_name: Optional[str] = None,
- alert_dynamic_properties: Optional[List["_models.AlertPropertyMapping"]] = None,
- **kwargs
- ):
+ def __init__(self, *, value: List["_models.AlertRuleTemplate"], **kwargs: Any) -> None:
"""
- :keyword alert_display_name_format: the format containing columns name(s) to override the alert
- name.
- :paramtype alert_display_name_format: str
- :keyword alert_description_format: the format containing columns name(s) to override the alert
- description.
- :paramtype alert_description_format: str
- :keyword alert_tactics_column_name: the column name to take the alert tactics from.
- :paramtype alert_tactics_column_name: str
- :keyword alert_severity_column_name: the column name to take the alert severity from.
- :paramtype alert_severity_column_name: str
- :keyword alert_dynamic_properties: List of additional dynamic properties to override.
- :paramtype alert_dynamic_properties:
- list[~azure.mgmt.securityinsight.models.AlertPropertyMapping]
+ :keyword value: Array of alert rule templates. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
"""
super().__init__(**kwargs)
- self.alert_display_name_format = alert_display_name_format
- self.alert_description_format = alert_description_format
- self.alert_tactics_column_name = alert_tactics_column_name
- self.alert_severity_column_name = alert_severity_column_name
- self.alert_dynamic_properties = alert_dynamic_properties
+ self.next_link = None
+ self.value = value
-class AlertPropertyMapping(_serialization.Model):
- """A single alert property mapping to override.
+class AlertsDataTypeOfDataConnector(_serialization.Model):
+ """Alerts data type for data connectors.
- :ivar alert_property: The V3 alert property. Known values are: "AlertLink", "ConfidenceLevel",
- "ConfidenceScore", "ExtendedLinks", "ProductName", "ProviderName", "ProductComponentName",
- "RemediationSteps", and "Techniques".
- :vartype alert_property: str or ~azure.mgmt.securityinsight.models.AlertProperty
- :ivar value: the column name to use to override this property.
- :vartype value: str
+ :ivar alerts: Alerts data type connection.
+ :vartype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
"""
_attribute_map = {
- "alert_property": {"key": "alertProperty", "type": "str"},
- "value": {"key": "value", "type": "str"},
+ "alerts": {"key": "alerts", "type": "DataConnectorDataTypeCommon"},
}
- def __init__(
- self,
- *,
- alert_property: Optional[Union[str, "_models.AlertProperty"]] = None,
- value: Optional[str] = None,
- **kwargs
- ):
+ def __init__(self, *, alerts: Optional["_models.DataConnectorDataTypeCommon"] = None, **kwargs: Any) -> None:
"""
- :keyword alert_property: The V3 alert property. Known values are: "AlertLink",
- "ConfidenceLevel", "ConfidenceScore", "ExtendedLinks", "ProductName", "ProviderName",
- "ProductComponentName", "RemediationSteps", and "Techniques".
- :paramtype alert_property: str or ~azure.mgmt.securityinsight.models.AlertProperty
- :keyword value: the column name to use to override this property.
- :paramtype value: str
+ :keyword alerts: Alerts data type connection.
+ :paramtype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
"""
super().__init__(**kwargs)
- self.alert_property = alert_property
- self.value = value
+ self.alerts = alerts
-class AlertRule(ResourceWithEtag):
- """Alert rule.
+class SecurityMLAnalyticsSetting(ResourceWithEtag):
+ """Security ML Analytics Setting.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- FusionAlertRule, MLBehaviorAnalyticsAlertRule, MicrosoftSecurityIncidentCreationAlertRule,
- NrtAlertRule, ScheduledAlertRule, ThreatIntelligenceAlertRule
+ AnomalySecurityMLAnalyticsSettings
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -2125,10 +1301,8 @@ class AlertRule(ResourceWithEtag):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
+ :ivar kind: The kind of security ML Analytics Settings. Required. "Anomaly"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsKind
"""
_validation = {
@@ -2148,18 +1322,9 @@ class AlertRule(ResourceWithEtag):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {
- "kind": {
- "Fusion": "FusionAlertRule",
- "MLBehaviorAnalytics": "MLBehaviorAnalyticsAlertRule",
- "MicrosoftSecurityIncidentCreation": "MicrosoftSecurityIncidentCreationAlertRule",
- "NRT": "NrtAlertRule",
- "Scheduled": "ScheduledAlertRule",
- "ThreatIntelligence": "ThreatIntelligenceAlertRule",
- }
- }
+ _subtype_map = {"kind": {"Anomaly": "AnomalySecurityMLAnalyticsSettings"}}
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -2168,53 +1333,15 @@ def __init__(self, *, etag: Optional[str] = None, **kwargs):
self.kind: Optional[str] = None
-class AlertRulesList(_serialization.Model):
- """List all the alert rules.
-
- 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 next_link: URL to fetch the next set of alert rules.
- :vartype next_link: str
- :ivar value: Array of alert rules. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.AlertRule]
- """
-
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[AlertRule]"},
- }
-
- def __init__(self, *, value: List["_models.AlertRule"], **kwargs):
- """
- :keyword value: Array of alert rules. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.AlertRule]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class AlertRuleTemplate(Resource):
- """Alert rule template.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- FusionAlertRuleTemplate, MLBehaviorAnalyticsAlertRuleTemplate,
- MicrosoftSecurityIncidentCreationAlertRuleTemplate, NrtAlertRuleTemplate,
- ScheduledAlertRuleTemplate, ThreatIntelligenceAlertRuleTemplate
+class AnomalySecurityMLAnalyticsSettings(SecurityMLAnalyticsSetting):
+ """Represents Anomaly Security ML Analytics Settings.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -2224,18 +1351,52 @@ class AlertRuleTemplate(Resource):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- """
-
- _validation = {
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The kind of security ML Analytics Settings. Required. "Anomaly"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsKind
+ :ivar description: The description of the SecurityMLAnalyticsSettings.
+ :vartype description: str
+ :ivar display_name: The display name for settings created by this SecurityMLAnalyticsSettings.
+ :vartype display_name: str
+ :ivar enabled: Determines whether this settings is enabled or disabled.
+ :vartype enabled: bool
+ :ivar last_modified_utc: The last time that this SecurityMLAnalyticsSettings has been modified.
+ :vartype last_modified_utc: ~datetime.datetime
+ :ivar required_data_connectors: The required data sources for this SecurityMLAnalyticsSettings.
+ :vartype required_data_connectors:
+ list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsDataSource]
+ :ivar tactics: The tactics of the SecurityMLAnalyticsSettings.
+ :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :ivar techniques: The techniques of the SecurityMLAnalyticsSettings.
+ :vartype techniques: list[str]
+ :ivar anomaly_version: The anomaly version of the AnomalySecurityMLAnalyticsSettings.
+ :vartype anomaly_version: str
+ :ivar customizable_observations: The customizable observations of the
+ AnomalySecurityMLAnalyticsSettings.
+ :vartype customizable_observations: JSON
+ :ivar frequency: The frequency that this SecurityMLAnalyticsSettings will be run.
+ :vartype frequency: ~datetime.timedelta
+ :ivar settings_status: The anomaly SecurityMLAnalyticsSettings status. Known values are:
+ "Production" and "Flighting".
+ :vartype settings_status: str or ~azure.mgmt.securityinsight.models.SettingsStatus
+ :ivar is_default_settings: Determines whether this anomaly security ml analytics settings is a
+ default settings.
+ :vartype is_default_settings: bool
+ :ivar anomaly_settings_version: The anomaly settings version of the Anomaly security ml
+ analytics settings that dictates whether job version gets updated or not.
+ :vartype anomaly_settings_version: int
+ :ivar settings_definition_id: The anomaly settings definition Id.
+ :vartype settings_definition_id: str
+ """
+
+ _validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
+ "last_modified_utc": {"readonly": True},
}
_attribute_map = {
@@ -2243,285 +1404,215 @@ class AlertRuleTemplate(Resource):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- }
-
- _subtype_map = {
- "kind": {
- "Fusion": "FusionAlertRuleTemplate",
- "MLBehaviorAnalytics": "MLBehaviorAnalyticsAlertRuleTemplate",
- "MicrosoftSecurityIncidentCreation": "MicrosoftSecurityIncidentCreationAlertRuleTemplate",
- "NRT": "NrtAlertRuleTemplate",
- "Scheduled": "ScheduledAlertRuleTemplate",
- "ThreatIntelligence": "ThreatIntelligenceAlertRuleTemplate",
- }
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: Optional[str] = None
-
-
-class AlertRuleTemplateDataSource(_serialization.Model):
- """alert rule template data sources.
-
- :ivar connector_id: The connector id that provides the following data types.
- :vartype connector_id: str
- :ivar data_types: The data types used by the alert rule template.
- :vartype data_types: list[str]
- """
-
- _attribute_map = {
- "connector_id": {"key": "connectorId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "[str]"},
- }
-
- def __init__(self, *, connector_id: Optional[str] = None, data_types: Optional[List[str]] = None, **kwargs):
- """
- :keyword connector_id: The connector id that provides the following data types.
- :paramtype connector_id: str
- :keyword data_types: The data types used by the alert rule template.
- :paramtype data_types: list[str]
- """
- super().__init__(**kwargs)
- self.connector_id = connector_id
- self.data_types = data_types
-
-
-class AlertRuleTemplatePropertiesBase(_serialization.Model):
- """Base alert rule template property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- """
-
- _validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
- }
-
- _attribute_map = {
- "alert_rules_created_by_template_count": {"key": "alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "createdDateUTC", "type": "iso-8601"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "required_data_connectors": {"key": "requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
- "status": {"key": "status", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "enabled": {"key": "properties.enabled", "type": "bool"},
+ "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
+ "required_data_connectors": {
+ "key": "properties.requiredDataConnectors",
+ "type": "[SecurityMLAnalyticsSettingsDataSource]",
+ },
+ "tactics": {"key": "properties.tactics", "type": "[str]"},
+ "techniques": {"key": "properties.techniques", "type": "[str]"},
+ "anomaly_version": {"key": "properties.anomalyVersion", "type": "str"},
+ "customizable_observations": {"key": "properties.customizableObservations", "type": "object"},
+ "frequency": {"key": "properties.frequency", "type": "duration"},
+ "settings_status": {"key": "properties.settingsStatus", "type": "str"},
+ "is_default_settings": {"key": "properties.isDefaultSettings", "type": "bool"},
+ "anomaly_settings_version": {"key": "properties.anomalySettingsVersion", "type": "int"},
+ "settings_definition_id": {"key": "properties.settingsDefinitionId", "type": "str"},
}
def __init__(
self,
*,
- alert_rules_created_by_template_count: Optional[int] = None,
+ etag: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- **kwargs
- ):
+ enabled: Optional[bool] = None,
+ required_data_connectors: Optional[List["_models.SecurityMLAnalyticsSettingsDataSource"]] = None,
+ tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
+ techniques: Optional[List[str]] = None,
+ anomaly_version: Optional[str] = None,
+ customizable_observations: Optional[JSON] = None,
+ frequency: Optional[datetime.timedelta] = None,
+ settings_status: Optional[Union[str, "_models.SettingsStatus"]] = None,
+ is_default_settings: Optional[bool] = None,
+ anomaly_settings_version: Optional[int] = None,
+ settings_definition_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword description: The description of the SecurityMLAnalyticsSettings.
:paramtype description: str
- :keyword display_name: The display name for alert rule template.
+ :keyword display_name: The display name for settings created by this
+ SecurityMLAnalyticsSettings.
:paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
+ :keyword enabled: Determines whether this settings is enabled or disabled.
+ :paramtype enabled: bool
+ :keyword required_data_connectors: The required data sources for this
+ SecurityMLAnalyticsSettings.
:paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
+ list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsDataSource]
+ :keyword tactics: The tactics of the SecurityMLAnalyticsSettings.
+ :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :keyword techniques: The techniques of the SecurityMLAnalyticsSettings.
+ :paramtype techniques: list[str]
+ :keyword anomaly_version: The anomaly version of the AnomalySecurityMLAnalyticsSettings.
+ :paramtype anomaly_version: str
+ :keyword customizable_observations: The customizable observations of the
+ AnomalySecurityMLAnalyticsSettings.
+ :paramtype customizable_observations: JSON
+ :keyword frequency: The frequency that this SecurityMLAnalyticsSettings will be run.
+ :paramtype frequency: ~datetime.timedelta
+ :keyword settings_status: The anomaly SecurityMLAnalyticsSettings status. Known values are:
+ "Production" and "Flighting".
+ :paramtype settings_status: str or ~azure.mgmt.securityinsight.models.SettingsStatus
+ :keyword is_default_settings: Determines whether this anomaly security ml analytics settings is
+ a default settings.
+ :paramtype is_default_settings: bool
+ :keyword anomaly_settings_version: The anomaly settings version of the Anomaly security ml
+ analytics settings that dictates whether job version gets updated or not.
+ :paramtype anomaly_settings_version: int
+ :keyword settings_definition_id: The anomaly settings definition Id.
+ :paramtype settings_definition_id: str
"""
- super().__init__(**kwargs)
- self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.last_updated_date_utc = None
- self.created_date_utc = None
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = "Anomaly"
self.description = description
self.display_name = display_name
+ self.enabled = enabled
+ self.last_modified_utc = None
self.required_data_connectors = required_data_connectors
- self.status = status
+ self.tactics = tactics
+ self.techniques = techniques
+ self.anomaly_version = anomaly_version
+ self.customizable_observations = customizable_observations
+ self.frequency = frequency
+ self.settings_status = settings_status
+ self.is_default_settings = is_default_settings
+ self.anomaly_settings_version = anomaly_settings_version
+ self.settings_definition_id = settings_definition_id
-class AlertRuleTemplatesList(_serialization.Model):
- """List all the alert rule templates.
+class CcpAuthConfig(_serialization.Model):
+ """Base Model for API authentication.
- Variables are only populated by the server, and will be ignored when sending a request.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ ApiKeyAuthModel, AWSAuthModel, BasicAuthModel, GCPAuthModel, GitHubAuthModel, JwtAuthModel,
+ NoneAuthModel, OAuthModel, OracleAuthModel, GenericBlobSbsAuthModel, SessionAuthModel
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar next_link: URL to fetch the next set of alert rule templates.
- :vartype next_link: str
- :ivar value: Array of alert rule templates. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ "type": {"required": True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[AlertRuleTemplate]"},
+ "type": {"key": "type", "type": "str"},
}
- def __init__(self, *, value: List["_models.AlertRuleTemplate"], **kwargs):
- """
- :keyword value: Array of alert rule templates. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
- """
+ _subtype_map = {
+ "type": {
+ "APIKey": "ApiKeyAuthModel",
+ "AWS": "AWSAuthModel",
+ "Basic": "BasicAuthModel",
+ "GCP": "GCPAuthModel",
+ "GitHub": "GitHubAuthModel",
+ "JwtToken": "JwtAuthModel",
+ "None": "NoneAuthModel",
+ "OAuth2": "OAuthModel",
+ "Oracle": "OracleAuthModel",
+ "ServiceBus": "GenericBlobSbsAuthModel",
+ "Session": "SessionAuthModel",
+ }
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ self.type: Optional[str] = None
-class AlertRuleTemplateWithMitreProperties(AlertRuleTemplatePropertiesBase):
- """Alert rule template with MITRE property bag.
+class ApiKeyAuthModel(CcpAuthConfig):
+ """Model for authentication with the API Key. Will result in additional header on the request
+ (default behavior) to the remote server: 'ApiKeyName: ApiKeyIdentifier ApiKey'. If
+ 'IsApiKeyInPostPayload' is true it will send it in the body of the request and not the header.
- 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 server.
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar api_key: API Key for the user secret key credential. Required.
+ :vartype api_key: str
+ :ivar api_key_name: API Key name. Required.
+ :vartype api_key_name: str
+ :ivar api_key_identifier: API Key Identifier.
+ :vartype api_key_identifier: str
+ :ivar is_api_key_in_post_payload: Flag to indicate if API key is set in HTTP POST payload.
+ :vartype is_api_key_in_post_payload: bool
"""
_validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ "type": {"required": True},
+ "api_key": {"required": True},
+ "api_key_name": {"required": True},
}
_attribute_map = {
- "alert_rules_created_by_template_count": {"key": "alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "createdDateUTC", "type": "iso-8601"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "required_data_connectors": {"key": "requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
- "status": {"key": "status", "type": "str"},
- "tactics": {"key": "tactics", "type": "[str]"},
- "techniques": {"key": "techniques", "type": "[str]"},
+ "type": {"key": "type", "type": "str"},
+ "api_key": {"key": "apiKey", "type": "str"},
+ "api_key_name": {"key": "apiKeyName", "type": "str"},
+ "api_key_identifier": {"key": "apiKeyIdentifier", "type": "str"},
+ "is_api_key_in_post_payload": {"key": "isApiKeyInPostPayload", "type": "bool"},
}
def __init__(
self,
*,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- """
- super().__init__(
- alert_rules_created_by_template_count=alert_rules_created_by_template_count,
- description=description,
- display_name=display_name,
- required_data_connectors=required_data_connectors,
- status=status,
- **kwargs
- )
- self.tactics = tactics
- self.techniques = techniques
-
-
-class AlertsDataTypeOfDataConnector(_serialization.Model):
- """Alerts data type for data connectors.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar alerts: Alerts data type connection. Required.
- :vartype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
- """
-
- _validation = {
- "alerts": {"required": True},
- }
-
- _attribute_map = {
- "alerts": {"key": "alerts", "type": "DataConnectorDataTypeCommon"},
- }
-
- def __init__(self, *, alerts: "_models.DataConnectorDataTypeCommon", **kwargs):
+ api_key: str,
+ api_key_name: str,
+ api_key_identifier: Optional[str] = None,
+ is_api_key_in_post_payload: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword alerts: Alerts data type connection. Required.
- :paramtype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
+ :keyword api_key: API Key for the user secret key credential. Required.
+ :paramtype api_key: str
+ :keyword api_key_name: API Key name. Required.
+ :paramtype api_key_name: str
+ :keyword api_key_identifier: API Key Identifier.
+ :paramtype api_key_identifier: str
+ :keyword is_api_key_in_post_payload: Flag to indicate if API key is set in HTTP POST payload.
+ :paramtype is_api_key_in_post_payload: bool
"""
super().__init__(**kwargs)
- self.alerts = alerts
-
+ self.type: str = "APIKey"
+ self.api_key = api_key
+ self.api_key_name = api_key_name
+ self.api_key_identifier = api_key_identifier
+ self.is_api_key_in_post_payload = is_api_key_in_post_payload
-class Settings(ResourceWithEtag):
- """The Setting.
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- Anomalies, EntityAnalytics, EyesOn, Ueba
+class ASCDataConnector(DataConnector):
+ """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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -2533,9 +1624,16 @@ class Settings(ResourceWithEtag):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the setting. Required. Known values are: "Anomalies", "EyesOn",
- "EntityAnalytics", and "Ueba".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SettingKind
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
+ :ivar data_types: The available data types for the connector.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :ivar subscription_id: The subscription id to connect to, and get the data from.
+ :vartype subscription_id: str
"""
_validation = {
@@ -2553,89 +1651,92 @@ class Settings(ResourceWithEtag):
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
+ "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
}
- _subtype_map = {
- "kind": {"Anomalies": "Anomalies", "EntityAnalytics": "EntityAnalytics", "EyesOn": "EyesOn", "Ueba": "Ueba"}
- }
-
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
+ subscription_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :keyword subscription_id: The subscription id to connect to, and get the data from.
+ :paramtype subscription_id: str
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
-
-class Anomalies(Settings):
- """Settings with single toggle.
+ self.kind: str = "AzureSecurityCenter"
+ self.data_types = data_types
+ self.subscription_id = subscription_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.
+class DataConnectorWithAlertsProperties(_serialization.Model):
+ """Data connector properties.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the setting. Required. Known values are: "Anomalies", "EyesOn",
- "EntityAnalytics", and "Ueba".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SettingKind
- :ivar is_enabled: Determines whether the setting is enable or disabled.
- :vartype is_enabled: bool
+ :ivar data_types: The available data types for the connector.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
"""
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "is_enabled": {"readonly": True},
+ _attribute_map = {
+ "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
}
+ def __init__(self, *, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs: Any) -> None:
+ """
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ """
+ super().__init__(**kwargs)
+ self.data_types = data_types
+
+
+class ASCDataConnectorProperties(DataConnectorWithAlertsProperties):
+ """ASC (Azure Security Center) data connector properties.
+
+ :ivar data_types: The available data types for the connector.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :ivar subscription_id: The subscription id to connect to, and get the data from.
+ :vartype subscription_id: str
+ """
+
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "is_enabled": {"key": "properties.isEnabled", "type": "bool"},
+ "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
+ "subscription_id": {"key": "subscriptionId", "type": "str"},
}
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
+ subscription_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :keyword subscription_id: The subscription id to connect to, and get the data from.
+ :paramtype subscription_id: str
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Anomalies"
- self.is_enabled = None
-
+ super().__init__(data_types=data_types, **kwargs)
+ self.subscription_id = subscription_id
-class SecurityMLAnalyticsSetting(ResourceWithEtag):
- """Security ML Analytics Setting.
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AnomalySecurityMLAnalyticsSettings
+class AutomationRule(ResourceWithEtag):
+ """AutomationRule.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -2647,8 +1748,22 @@ class SecurityMLAnalyticsSetting(ResourceWithEtag):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of security ML Analytics Settings. Required. "Anomaly"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsKind
+ :ivar display_name: The display name of the automation rule. Required.
+ :vartype display_name: str
+ :ivar order: The order of execution of the automation rule. Required.
+ :vartype order: int
+ :ivar triggering_logic: Describes automation rule triggering logic. Required.
+ :vartype triggering_logic: ~azure.mgmt.securityinsight.models.AutomationRuleTriggeringLogic
+ :ivar actions: The actions to execute when the automation rule is triggered. Required.
+ :vartype actions: list[~azure.mgmt.securityinsight.models.AutomationRuleAction]
+ :ivar last_modified_time_utc: The last time the automation rule was updated.
+ :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar created_time_utc: The time the automation rule was created.
+ :vartype created_time_utc: ~datetime.datetime
+ :ivar last_modified_by: Information on the client (user or application) that made some action.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.ClientInfo
+ :ivar created_by: Information on the client (user or application) that made some action.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.ClientInfo
"""
_validation = {
@@ -2656,7 +1771,14 @@ class SecurityMLAnalyticsSetting(ResourceWithEtag):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
+ "display_name": {"required": True, "max_length": 500},
+ "order": {"required": True, "maximum": 1000, "minimum": 1},
+ "triggering_logic": {"required": True},
+ "actions": {"required": True, "max_items": 20, "min_items": 0},
+ "last_modified_time_utc": {"readonly": True},
+ "created_time_utc": {"readonly": True},
+ "last_modified_by": {"readonly": True},
+ "created_by": {"readonly": True},
}
_attribute_map = {
@@ -2665,589 +1787,221 @@ class SecurityMLAnalyticsSetting(ResourceWithEtag):
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "order": {"key": "properties.order", "type": "int"},
+ "triggering_logic": {"key": "properties.triggeringLogic", "type": "AutomationRuleTriggeringLogic"},
+ "actions": {"key": "properties.actions", "type": "[AutomationRuleAction]"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "ClientInfo"},
+ "created_by": {"key": "properties.createdBy", "type": "ClientInfo"},
}
- _subtype_map = {"kind": {"Anomaly": "AnomalySecurityMLAnalyticsSettings"}}
-
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ display_name: str,
+ order: int,
+ triggering_logic: "_models.AutomationRuleTriggeringLogic",
+ actions: List["_models.AutomationRuleAction"],
+ etag: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
+ :keyword display_name: The display name of the automation rule. Required.
+ :paramtype display_name: str
+ :keyword order: The order of execution of the automation rule. Required.
+ :paramtype order: int
+ :keyword triggering_logic: Describes automation rule triggering logic. Required.
+ :paramtype triggering_logic: ~azure.mgmt.securityinsight.models.AutomationRuleTriggeringLogic
+ :keyword actions: The actions to execute when the automation rule is triggered. Required.
+ :paramtype actions: list[~azure.mgmt.securityinsight.models.AutomationRuleAction]
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
+ self.display_name = display_name
+ self.order = order
+ self.triggering_logic = triggering_logic
+ self.actions = actions
+ self.last_modified_time_utc = None
+ self.created_time_utc = None
+ self.last_modified_by = None
+ self.created_by = None
-class AnomalySecurityMLAnalyticsSettings(SecurityMLAnalyticsSetting): # pylint: disable=too-many-instance-attributes
- """Represents Anomaly Security ML Analytics Settings.
+class AutomationRuleAction(_serialization.Model):
+ """Describes an automation rule action.
- Variables are only populated by the server, and will be ignored when sending a request.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ AutomationRuleAddIncidentTaskAction, AutomationRuleModifyPropertiesAction,
+ AutomationRuleRunPlaybookAction
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of security ML Analytics Settings. Required. "Anomaly"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsKind
- :ivar description: The description of the SecurityMLAnalyticsSettings.
- :vartype description: str
- :ivar display_name: The display name for settings created by this SecurityMLAnalyticsSettings.
- :vartype display_name: str
- :ivar enabled: Determines whether this settings is enabled or disabled.
- :vartype enabled: bool
- :ivar last_modified_utc: The last time that this SecurityMLAnalyticsSettings has been modified.
- :vartype last_modified_utc: ~datetime.datetime
- :ivar required_data_connectors: The required data sources for this SecurityMLAnalyticsSettings.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsDataSource]
- :ivar tactics: The tactics of the SecurityMLAnalyticsSettings.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the SecurityMLAnalyticsSettings.
- :vartype techniques: list[str]
- :ivar anomaly_version: The anomaly version of the AnomalySecurityMLAnalyticsSettings.
- :vartype anomaly_version: str
- :ivar customizable_observations: The customizable observations of the
- AnomalySecurityMLAnalyticsSettings.
- :vartype customizable_observations: JSON
- :ivar frequency: The frequency that this SecurityMLAnalyticsSettings will be run.
- :vartype frequency: ~datetime.timedelta
- :ivar settings_status: The anomaly SecurityMLAnalyticsSettings status. Known values are:
- "Production" and "Flighting".
- :vartype settings_status: str or ~azure.mgmt.securityinsight.models.SettingsStatus
- :ivar is_default_settings: Determines whether this anomaly security ml analytics settings is a
- default settings.
- :vartype is_default_settings: bool
- :ivar anomaly_settings_version: The anomaly settings version of the Anomaly security ml
- analytics settings that dictates whether job version gets updated or not.
- :vartype anomaly_settings_version: int
- :ivar settings_definition_id: The anomaly settings definition Id.
- :vartype settings_definition_id: str
+ :ivar order: Required.
+ :vartype order: int
+ :ivar action_type: The type of the automation rule action. Required. Known values are:
+ "ModifyProperties", "RunPlaybook", and "AddIncidentTask".
+ :vartype action_type: str or ~azure.mgmt.securityinsight.models.ActionType
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_modified_utc": {"readonly": True},
+ "order": {"required": True},
+ "action_type": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
- "required_data_connectors": {
- "key": "properties.requiredDataConnectors",
- "type": "[SecurityMLAnalyticsSettingsDataSource]",
- },
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
- "anomaly_version": {"key": "properties.anomalyVersion", "type": "str"},
- "customizable_observations": {"key": "properties.customizableObservations", "type": "object"},
- "frequency": {"key": "properties.frequency", "type": "duration"},
- "settings_status": {"key": "properties.settingsStatus", "type": "str"},
- "is_default_settings": {"key": "properties.isDefaultSettings", "type": "bool"},
- "anomaly_settings_version": {"key": "properties.anomalySettingsVersion", "type": "int"},
- "settings_definition_id": {"key": "properties.settingsDefinitionId", "type": "str"},
+ "order": {"key": "order", "type": "int"},
+ "action_type": {"key": "actionType", "type": "str"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- required_data_connectors: Optional[List["_models.SecurityMLAnalyticsSettingsDataSource"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- anomaly_version: Optional[str] = None,
- customizable_observations: Optional[JSON] = None,
- frequency: Optional[datetime.timedelta] = None,
- settings_status: Optional[Union[str, "_models.SettingsStatus"]] = None,
- is_default_settings: Optional[bool] = None,
- anomaly_settings_version: Optional[int] = None,
- settings_definition_id: Optional[str] = None,
- **kwargs
- ):
+ _subtype_map = {
+ "action_type": {
+ "AddIncidentTask": "AutomationRuleAddIncidentTaskAction",
+ "ModifyProperties": "AutomationRuleModifyPropertiesAction",
+ "RunPlaybook": "AutomationRuleRunPlaybookAction",
+ }
+ }
+
+ def __init__(self, *, order: int, **kwargs: Any) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword description: The description of the SecurityMLAnalyticsSettings.
- :paramtype description: str
- :keyword display_name: The display name for settings created by this
- SecurityMLAnalyticsSettings.
- :paramtype display_name: str
- :keyword enabled: Determines whether this settings is enabled or disabled.
- :paramtype enabled: bool
- :keyword required_data_connectors: The required data sources for this
- SecurityMLAnalyticsSettings.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSettingsDataSource]
- :keyword tactics: The tactics of the SecurityMLAnalyticsSettings.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the SecurityMLAnalyticsSettings.
- :paramtype techniques: list[str]
- :keyword anomaly_version: The anomaly version of the AnomalySecurityMLAnalyticsSettings.
- :paramtype anomaly_version: str
- :keyword customizable_observations: The customizable observations of the
- AnomalySecurityMLAnalyticsSettings.
- :paramtype customizable_observations: JSON
- :keyword frequency: The frequency that this SecurityMLAnalyticsSettings will be run.
- :paramtype frequency: ~datetime.timedelta
- :keyword settings_status: The anomaly SecurityMLAnalyticsSettings status. Known values are:
- "Production" and "Flighting".
- :paramtype settings_status: str or ~azure.mgmt.securityinsight.models.SettingsStatus
- :keyword is_default_settings: Determines whether this anomaly security ml analytics settings is
- a default settings.
- :paramtype is_default_settings: bool
- :keyword anomaly_settings_version: The anomaly settings version of the Anomaly security ml
- analytics settings that dictates whether job version gets updated or not.
- :paramtype anomaly_settings_version: int
- :keyword settings_definition_id: The anomaly settings definition Id.
- :paramtype settings_definition_id: str
+ :keyword order: Required.
+ :paramtype order: int
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Anomaly"
- self.description = description
- self.display_name = display_name
- self.enabled = enabled
- self.last_modified_utc = None
- self.required_data_connectors = required_data_connectors
- self.tactics = tactics
- self.techniques = techniques
- self.anomaly_version = anomaly_version
- self.customizable_observations = customizable_observations
- self.frequency = frequency
- self.settings_status = settings_status
- self.is_default_settings = is_default_settings
- self.anomaly_settings_version = anomaly_settings_version
- self.settings_definition_id = settings_definition_id
+ super().__init__(**kwargs)
+ self.order = order
+ self.action_type: Optional[str] = None
-class AnomalyTimelineItem(EntityTimelineItem): # pylint: disable=too-many-instance-attributes
- """Represents anomaly timeline item.
+class AutomationRuleAddIncidentTaskAction(AutomationRuleAction):
+ """Describes an automation rule action to add a task to an incident.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar kind: The entity query kind type. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- :ivar azure_resource_id: The anomaly azure resource id. Required.
- :vartype azure_resource_id: str
- :ivar product_name: The anomaly product name.
- :vartype product_name: str
- :ivar description: The anomaly description.
- :vartype description: str
- :ivar display_name: The anomaly name. Required.
- :vartype display_name: str
- :ivar end_time_utc: The anomaly end time. Required.
- :vartype end_time_utc: ~datetime.datetime
- :ivar start_time_utc: The anomaly start time. Required.
- :vartype start_time_utc: ~datetime.datetime
- :ivar time_generated: The anomaly generated time. Required.
- :vartype time_generated: ~datetime.datetime
- :ivar vendor: The name of the anomaly vendor.
- :vartype vendor: str
- :ivar intent: The intent of the anomaly.
- :vartype intent: str
- :ivar techniques: The techniques of the anomaly.
- :vartype techniques: list[str]
- :ivar reasons: The reasons that cause the anomaly.
- :vartype reasons: list[str]
+ :ivar order: Required.
+ :vartype order: int
+ :ivar action_type: The type of the automation rule action. Required. Known values are:
+ "ModifyProperties", "RunPlaybook", and "AddIncidentTask".
+ :vartype action_type: str or ~azure.mgmt.securityinsight.models.ActionType
+ :ivar action_configuration: Describes an automation rule action to add a task to an incident.
+ :vartype action_configuration:
+ ~azure.mgmt.securityinsight.models.AddIncidentTaskActionProperties
"""
_validation = {
- "kind": {"required": True},
- "azure_resource_id": {"required": True},
- "display_name": {"required": True},
- "end_time_utc": {"required": True},
- "start_time_utc": {"required": True},
- "time_generated": {"required": True},
+ "order": {"required": True},
+ "action_type": {"required": True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "azure_resource_id": {"key": "azureResourceId", "type": "str"},
- "product_name": {"key": "productName", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"},
- "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"},
- "time_generated": {"key": "timeGenerated", "type": "iso-8601"},
- "vendor": {"key": "vendor", "type": "str"},
- "intent": {"key": "intent", "type": "str"},
- "techniques": {"key": "techniques", "type": "[str]"},
- "reasons": {"key": "reasons", "type": "[str]"},
+ "order": {"key": "order", "type": "int"},
+ "action_type": {"key": "actionType", "type": "str"},
+ "action_configuration": {"key": "actionConfiguration", "type": "AddIncidentTaskActionProperties"},
}
def __init__(
self,
*,
- azure_resource_id: str,
- display_name: str,
- end_time_utc: datetime.datetime,
- start_time_utc: datetime.datetime,
- time_generated: datetime.datetime,
- product_name: Optional[str] = None,
- description: Optional[str] = None,
- vendor: Optional[str] = None,
- intent: Optional[str] = None,
- techniques: Optional[List[str]] = None,
- reasons: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword azure_resource_id: The anomaly azure resource id. Required.
- :paramtype azure_resource_id: str
- :keyword product_name: The anomaly product name.
- :paramtype product_name: str
- :keyword description: The anomaly description.
- :paramtype description: str
- :keyword display_name: The anomaly name. Required.
- :paramtype display_name: str
- :keyword end_time_utc: The anomaly end time. Required.
- :paramtype end_time_utc: ~datetime.datetime
- :keyword start_time_utc: The anomaly start time. Required.
- :paramtype start_time_utc: ~datetime.datetime
- :keyword time_generated: The anomaly generated time. Required.
- :paramtype time_generated: ~datetime.datetime
- :keyword vendor: The name of the anomaly vendor.
- :paramtype vendor: str
- :keyword intent: The intent of the anomaly.
- :paramtype intent: str
- :keyword techniques: The techniques of the anomaly.
- :paramtype techniques: list[str]
- :keyword reasons: The reasons that cause the anomaly.
- :paramtype reasons: list[str]
+ order: int,
+ action_configuration: Optional["_models.AddIncidentTaskActionProperties"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- super().__init__(**kwargs)
- self.kind: str = "Anomaly"
- self.azure_resource_id = azure_resource_id
- self.product_name = product_name
- self.description = description
- self.display_name = display_name
- self.end_time_utc = end_time_utc
- self.start_time_utc = start_time_utc
- self.time_generated = time_generated
- self.vendor = vendor
- self.intent = intent
- self.techniques = techniques
- self.reasons = reasons
-
+ :keyword order: Required.
+ :paramtype order: int
+ :keyword action_configuration: Describes an automation rule action to add a task to an
+ incident.
+ :paramtype action_configuration:
+ ~azure.mgmt.securityinsight.models.AddIncidentTaskActionProperties
+ """
+ super().__init__(order=order, **kwargs)
+ self.action_type: str = "AddIncidentTask"
+ self.action_configuration = action_configuration
-class ASCCheckRequirements(DataConnectorsCheckRequirements):
- """Represents ASC (Azure Security Center) requirements check request.
- All required parameters must be populated in order to send to Azure.
+class AutomationRuleBooleanCondition(_serialization.Model):
+ """Describes an automation rule condition with boolean operators.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar subscription_id: The subscription id to connect to, and get the data from.
- :vartype subscription_id: str
+ :ivar operator: Describes a boolean condition operator. Known values are: "And", "Or", "And",
+ and "Or".
+ :vartype operator: str or
+ ~azure.mgmt.securityinsight.models.AutomationRuleBooleanConditionSupportedOperator
+ :ivar inner_conditions:
+ :vartype inner_conditions: list[~azure.mgmt.securityinsight.models.AutomationRuleCondition]
"""
_validation = {
- "kind": {"required": True},
+ "inner_conditions": {"max_items": 10, "min_items": 2},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
+ "operator": {"key": "operator", "type": "str"},
+ "inner_conditions": {"key": "innerConditions", "type": "[AutomationRuleCondition]"},
}
- def __init__(self, *, subscription_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ operator: Optional[Union[str, "_models.AutomationRuleBooleanConditionSupportedOperator"]] = None,
+ inner_conditions: Optional[List["_models.AutomationRuleCondition"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
+ :keyword operator: Describes a boolean condition operator. Known values are: "And", "Or",
+ "And", and "Or".
+ :paramtype operator: str or
+ ~azure.mgmt.securityinsight.models.AutomationRuleBooleanConditionSupportedOperator
+ :keyword inner_conditions:
+ :paramtype inner_conditions: list[~azure.mgmt.securityinsight.models.AutomationRuleCondition]
"""
super().__init__(**kwargs)
- self.kind: str = "AzureSecurityCenter"
- self.subscription_id = subscription_id
+ self.operator = operator
+ self.inner_conditions = inner_conditions
-class ASCDataConnector(DataConnector):
- """Represents ASC (Azure Security Center) data connector.
+class AutomationRuleCondition(_serialization.Model):
+ """Describes an automation rule condition.
- Variables are only populated by the server, and will be ignored when sending a request.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ BooleanConditionProperties, PropertyConditionProperties, PropertyArrayConditionProperties,
+ PropertyArrayChangedConditionProperties, PropertyChangedConditionProperties
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar subscription_id: The subscription id to connect to, and get the data from.
- :vartype subscription_id: str
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- subscription_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "AzureSecurityCenter"
- self.data_types = data_types
- self.subscription_id = subscription_id
-
-
-class ASCDataConnectorProperties(DataConnectorWithAlertsProperties):
- """ASC (Azure Security Center) data connector properties.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar subscription_id: The subscription id to connect to, and get the data from.
- :vartype subscription_id: str
- """
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "subscription_id": {"key": "subscriptionId", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- subscription_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
- """
- super().__init__(data_types=data_types, **kwargs)
- self.subscription_id = subscription_id
-
-
-class AutomationRule(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """AutomationRule.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar display_name: The display name of the automation rule. Required.
- :vartype display_name: str
- :ivar order: The order of execution of the automation rule. Required.
- :vartype order: int
- :ivar triggering_logic: Describes automation rule triggering logic. Required.
- :vartype triggering_logic: ~azure.mgmt.securityinsight.models.AutomationRuleTriggeringLogic
- :ivar actions: The actions to execute when the automation rule is triggered. Required.
- :vartype actions: list[~azure.mgmt.securityinsight.models.AutomationRuleAction]
- :ivar last_modified_time_utc: The last time the automation rule was updated.
- :vartype last_modified_time_utc: ~datetime.datetime
- :ivar created_time_utc: The time the automation rule was created.
- :vartype created_time_utc: ~datetime.datetime
- :ivar last_modified_by: Information on the client (user or application) that made some action.
- :vartype last_modified_by: ~azure.mgmt.securityinsight.models.ClientInfo
- :ivar created_by: Information on the client (user or application) that made some action.
- :vartype created_by: ~azure.mgmt.securityinsight.models.ClientInfo
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "display_name": {"required": True, "max_length": 500},
- "order": {"required": True, "maximum": 1000, "minimum": 1},
- "triggering_logic": {"required": True},
- "actions": {"required": True, "max_items": 20, "min_items": 0},
- "last_modified_time_utc": {"readonly": True},
- "created_time_utc": {"readonly": True},
- "last_modified_by": {"readonly": True},
- "created_by": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "order": {"key": "properties.order", "type": "int"},
- "triggering_logic": {"key": "properties.triggeringLogic", "type": "AutomationRuleTriggeringLogic"},
- "actions": {"key": "properties.actions", "type": "[AutomationRuleAction]"},
- "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
- "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
- "last_modified_by": {"key": "properties.lastModifiedBy", "type": "ClientInfo"},
- "created_by": {"key": "properties.createdBy", "type": "ClientInfo"},
- }
-
- def __init__(
- self,
- *,
- display_name: str,
- order: int,
- triggering_logic: "_models.AutomationRuleTriggeringLogic",
- actions: List["_models.AutomationRuleAction"],
- etag: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword display_name: The display name of the automation rule. Required.
- :paramtype display_name: str
- :keyword order: The order of execution of the automation rule. Required.
- :paramtype order: int
- :keyword triggering_logic: Describes automation rule triggering logic. Required.
- :paramtype triggering_logic: ~azure.mgmt.securityinsight.models.AutomationRuleTriggeringLogic
- :keyword actions: The actions to execute when the automation rule is triggered. Required.
- :paramtype actions: list[~azure.mgmt.securityinsight.models.AutomationRuleAction]
- """
- super().__init__(etag=etag, **kwargs)
- self.display_name = display_name
- self.order = order
- self.triggering_logic = triggering_logic
- self.actions = actions
- self.last_modified_time_utc = None
- self.created_time_utc = None
- self.last_modified_by = None
- self.created_by = None
-
-
-class AutomationRuleAction(_serialization.Model):
- """Describes an automation rule action.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AutomationRuleAddIncidentTaskAction, AutomationRuleModifyPropertiesAction,
- AutomationRuleRunPlaybookAction
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar order: Required.
- :vartype order: int
- :ivar action_type: The type of the automation rule action. Required. Known values are:
- "ModifyProperties", "RunPlaybook", and "AddIncidentTask".
- :vartype action_type: str or ~azure.mgmt.securityinsight.models.ActionType
+ :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
+ "PropertyChanged", "PropertyArrayChanged", and "Boolean".
+ :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
"""
_validation = {
- "order": {"required": True},
- "action_type": {"required": True},
+ "condition_type": {"required": True},
}
_attribute_map = {
- "order": {"key": "order", "type": "int"},
- "action_type": {"key": "actionType", "type": "str"},
+ "condition_type": {"key": "conditionType", "type": "str"},
}
_subtype_map = {
- "action_type": {
- "AddIncidentTask": "AutomationRuleAddIncidentTaskAction",
- "ModifyProperties": "AutomationRuleModifyPropertiesAction",
- "RunPlaybook": "AutomationRuleRunPlaybookAction",
+ "condition_type": {
+ "Boolean": "BooleanConditionProperties",
+ "Property": "PropertyConditionProperties",
+ "PropertyArray": "PropertyArrayConditionProperties",
+ "PropertyArrayChanged": "PropertyArrayChangedConditionProperties",
+ "PropertyChanged": "PropertyChangedConditionProperties",
}
}
- def __init__(self, *, order: int, **kwargs):
- """
- :keyword order: Required.
- :paramtype order: int
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.order = order
- self.action_type: Optional[str] = None
+ self.condition_type: Optional[str] = None
-class AutomationRuleAddIncidentTaskAction(AutomationRuleAction):
- """Describes an automation rule action to add a task to an incident.
+class AutomationRuleModifyPropertiesAction(AutomationRuleAction):
+ """Describes an automation rule action to modify an object's properties.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar order: Required.
:vartype order: int
@@ -3255,8 +2009,7 @@ class AutomationRuleAddIncidentTaskAction(AutomationRuleAction):
"ModifyProperties", "RunPlaybook", and "AddIncidentTask".
:vartype action_type: str or ~azure.mgmt.securityinsight.models.ActionType
:ivar action_configuration:
- :vartype action_configuration:
- ~azure.mgmt.securityinsight.models.AddIncidentTaskActionProperties
+ :vartype action_configuration: ~azure.mgmt.securityinsight.models.IncidentPropertiesAction
"""
_validation = {
@@ -3267,166 +2020,50 @@ class AutomationRuleAddIncidentTaskAction(AutomationRuleAction):
_attribute_map = {
"order": {"key": "order", "type": "int"},
"action_type": {"key": "actionType", "type": "str"},
- "action_configuration": {"key": "actionConfiguration", "type": "AddIncidentTaskActionProperties"},
+ "action_configuration": {"key": "actionConfiguration", "type": "IncidentPropertiesAction"},
}
def __init__(
- self, *, order: int, action_configuration: Optional["_models.AddIncidentTaskActionProperties"] = None, **kwargs
- ):
+ self, *, order: int, action_configuration: Optional["_models.IncidentPropertiesAction"] = None, **kwargs: Any
+ ) -> None:
"""
:keyword order: Required.
:paramtype order: int
:keyword action_configuration:
- :paramtype action_configuration:
- ~azure.mgmt.securityinsight.models.AddIncidentTaskActionProperties
+ :paramtype action_configuration: ~azure.mgmt.securityinsight.models.IncidentPropertiesAction
"""
super().__init__(order=order, **kwargs)
- self.action_type: str = "AddIncidentTask"
+ self.action_type: str = "ModifyProperties"
self.action_configuration = action_configuration
-class AutomationRuleBooleanCondition(_serialization.Model):
- """AutomationRuleBooleanCondition.
+class AutomationRulePropertyArrayChangedValuesCondition(_serialization.Model): # pylint: disable=name-too-long
+ """AutomationRulePropertyArrayChangedValuesCondition.
- :ivar operator: Known values are: "And" and "Or".
- :vartype operator: str or
- ~azure.mgmt.securityinsight.models.AutomationRuleBooleanConditionSupportedOperator
- :ivar inner_conditions:
- :vartype inner_conditions: list[~azure.mgmt.securityinsight.models.AutomationRuleCondition]
+ :ivar array_type: Known values are: "Alerts", "Labels", "Tactics", and "Comments".
+ :vartype array_type: str or
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedConditionSupportedArrayType
+ :ivar change_type: "Added"
+ :vartype change_type: str or
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedConditionSupportedChangeType
"""
- _validation = {
- "inner_conditions": {"max_items": 10, "min_items": 2},
- }
-
_attribute_map = {
- "operator": {"key": "operator", "type": "str"},
- "inner_conditions": {"key": "innerConditions", "type": "[AutomationRuleCondition]"},
+ "array_type": {"key": "arrayType", "type": "str"},
+ "change_type": {"key": "changeType", "type": "str"},
}
def __init__(
self,
*,
- operator: Optional[Union[str, "_models.AutomationRuleBooleanConditionSupportedOperator"]] = None,
- inner_conditions: Optional[List["_models.AutomationRuleCondition"]] = None,
- **kwargs
- ):
- """
- :keyword operator: Known values are: "And" and "Or".
- :paramtype operator: str or
- ~azure.mgmt.securityinsight.models.AutomationRuleBooleanConditionSupportedOperator
- :keyword inner_conditions:
- :paramtype inner_conditions: list[~azure.mgmt.securityinsight.models.AutomationRuleCondition]
- """
- super().__init__(**kwargs)
- self.operator = operator
- self.inner_conditions = inner_conditions
-
-
-class AutomationRuleCondition(_serialization.Model):
- """Describes an automation rule condition.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- BooleanConditionProperties, PropertyConditionProperties, PropertyArrayConditionProperties,
- PropertyArrayChangedConditionProperties, PropertyChangedConditionProperties
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
- "PropertyChanged", "PropertyArrayChanged", and "Boolean".
- :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
- """
-
- _validation = {
- "condition_type": {"required": True},
- }
-
- _attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- }
-
- _subtype_map = {
- "condition_type": {
- "Boolean": "BooleanConditionProperties",
- "Property": "PropertyConditionProperties",
- "PropertyArray": "PropertyArrayConditionProperties",
- "PropertyArrayChanged": "PropertyArrayChangedConditionProperties",
- "PropertyChanged": "PropertyChangedConditionProperties",
- }
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.condition_type: Optional[str] = None
-
-
-class AutomationRuleModifyPropertiesAction(AutomationRuleAction):
- """Describes an automation rule action to modify an object's properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar order: Required.
- :vartype order: int
- :ivar action_type: The type of the automation rule action. Required. Known values are:
- "ModifyProperties", "RunPlaybook", and "AddIncidentTask".
- :vartype action_type: str or ~azure.mgmt.securityinsight.models.ActionType
- :ivar action_configuration:
- :vartype action_configuration: ~azure.mgmt.securityinsight.models.IncidentPropertiesAction
- """
-
- _validation = {
- "order": {"required": True},
- "action_type": {"required": True},
- }
-
- _attribute_map = {
- "order": {"key": "order", "type": "int"},
- "action_type": {"key": "actionType", "type": "str"},
- "action_configuration": {"key": "actionConfiguration", "type": "IncidentPropertiesAction"},
- }
-
- def __init__(
- self, *, order: int, action_configuration: Optional["_models.IncidentPropertiesAction"] = None, **kwargs
- ):
- """
- :keyword order: Required.
- :paramtype order: int
- :keyword action_configuration:
- :paramtype action_configuration: ~azure.mgmt.securityinsight.models.IncidentPropertiesAction
- """
- super().__init__(order=order, **kwargs)
- self.action_type: str = "ModifyProperties"
- self.action_configuration = action_configuration
-
-
-class AutomationRulePropertyArrayChangedValuesCondition(_serialization.Model):
- """AutomationRulePropertyArrayChangedValuesCondition.
-
- :ivar array_type: Known values are: "Alerts", "Labels", "Tactics", and "Comments".
- :vartype array_type: str or
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedConditionSupportedArrayType
- :ivar change_type: "Added"
- :vartype change_type: str or
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedConditionSupportedChangeType
- """
-
- _attribute_map = {
- "array_type": {"key": "arrayType", "type": "str"},
- "change_type": {"key": "changeType", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- array_type: Optional[
- Union[str, "_models.AutomationRulePropertyArrayChangedConditionSupportedArrayType"]
- ] = None,
- change_type: Optional[
- Union[str, "_models.AutomationRulePropertyArrayChangedConditionSupportedChangeType"]
- ] = None,
- **kwargs
- ):
+ array_type: Optional[
+ Union[str, "_models.AutomationRulePropertyArrayChangedConditionSupportedArrayType"]
+ ] = None,
+ change_type: Optional[
+ Union[str, "_models.AutomationRulePropertyArrayChangedConditionSupportedChangeType"]
+ ] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword array_type: Known values are: "Alerts", "Labels", "Tactics", and "Comments".
:paramtype array_type: str or
@@ -3440,13 +2077,14 @@ def __init__(
self.change_type = change_type
-class AutomationRulePropertyArrayValuesCondition(_serialization.Model):
- """AutomationRulePropertyArrayValuesCondition.
+class AutomationRulePropertyArrayValuesCondition(_serialization.Model): # pylint: disable=name-too-long
+ """Describes an automation rule condition on array properties.
- :ivar array_type: Known values are: "CustomDetails" and "CustomDetailValues".
+ :ivar array_type: Describes an array condition evaluated array type. Known values are:
+ "CustomDetails" and "CustomDetailValues".
:vartype array_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayType
- :ivar array_condition_type: "AnyItem"
+ :ivar array_condition_type: Describes an array condition evaluation type. "AnyItem"
:vartype array_condition_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType
:ivar item_conditions:
@@ -3471,13 +2109,14 @@ def __init__(
Union[str, "_models.AutomationRulePropertyArrayConditionSupportedArrayConditionType"]
] = None,
item_conditions: Optional[List["_models.AutomationRuleCondition"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
- :keyword array_type: Known values are: "CustomDetails" and "CustomDetailValues".
+ :keyword array_type: Describes an array condition evaluated array type. Known values are:
+ "CustomDetails" and "CustomDetailValues".
:paramtype array_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayType
- :keyword array_condition_type: "AnyItem"
+ :keyword array_condition_type: Describes an array condition evaluation type. "AnyItem"
:paramtype array_condition_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType
:keyword item_conditions:
@@ -3489,7 +2128,7 @@ def __init__(
self.item_conditions = item_conditions
-class AutomationRulePropertyValuesChangedCondition(_serialization.Model):
+class AutomationRulePropertyValuesChangedCondition(_serialization.Model): # pylint: disable=name-too-long
"""AutomationRulePropertyValuesChangedCondition.
:ivar property_name: Known values are: "IncidentSeverity", "IncidentStatus", and
@@ -3523,8 +2162,8 @@ def __init__(
change_type: Optional[Union[str, "_models.AutomationRulePropertyChangedConditionSupportedChangedType"]] = None,
operator: Optional[Union[str, "_models.AutomationRulePropertyConditionSupportedOperator"]] = None,
property_values: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword property_name: Known values are: "IncidentSeverity", "IncidentStatus", and
"IncidentOwner".
@@ -3588,8 +2227,8 @@ def __init__(
property_name: Optional[Union[str, "_models.AutomationRulePropertyConditionSupportedProperty"]] = None,
operator: Optional[Union[str, "_models.AutomationRulePropertyConditionSupportedOperator"]] = None,
property_values: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword property_name: The property to evaluate in an automation rule property condition.
Known values are: "IncidentTitle", "IncidentDescription", "IncidentSeverity", "IncidentStatus",
@@ -3625,7 +2264,7 @@ def __init__(
class AutomationRuleRunPlaybookAction(AutomationRuleAction):
"""Describes an automation rule action to run a playbook.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar order: Required.
:vartype order: int
@@ -3648,8 +2287,8 @@ class AutomationRuleRunPlaybookAction(AutomationRuleAction):
}
def __init__(
- self, *, order: int, action_configuration: Optional["_models.PlaybookActionProperties"] = None, **kwargs
- ):
+ self, *, order: int, action_configuration: Optional["_models.PlaybookActionProperties"] = None, **kwargs: Any
+ ) -> None:
"""
:keyword order: Required.
:paramtype order: int
@@ -3676,8 +2315,8 @@ class AutomationRulesList(_serialization.Model):
}
def __init__(
- self, *, value: Optional[List["_models.AutomationRule"]] = None, next_link: Optional[str] = None, **kwargs
- ):
+ self, *, value: Optional[List["_models.AutomationRule"]] = None, next_link: Optional[str] = None, **kwargs: Any
+ ) -> None:
"""
:keyword value:
:paramtype value: list[~azure.mgmt.securityinsight.models.AutomationRule]
@@ -3692,7 +2331,7 @@ def __init__(
class AutomationRuleTriggeringLogic(_serialization.Model):
"""Describes automation rule triggering logic.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar is_enabled: Determines whether the automation rule is enabled or disabled. Required.
:vartype is_enabled: bool
@@ -3731,8 +2370,8 @@ def __init__(
triggers_when: Union[str, "_models.TriggersWhen"],
expiration_time_utc: Optional[datetime.datetime] = None,
conditions: Optional[List["_models.AutomationRuleCondition"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword is_enabled: Determines whether the automation rule is enabled or disabled. Required.
:paramtype is_enabled: bool
@@ -3755,59 +2394,44 @@ def __init__(
self.conditions = conditions
-class Availability(_serialization.Model):
- """Connector Availability Status.
-
- :ivar status: The connector Availability Status. Default value is 1.
- :vartype status: int
- :ivar is_preview: Set connector as preview.
- :vartype is_preview: bool
- """
-
- _attribute_map = {
- "status": {"key": "status", "type": "int"},
- "is_preview": {"key": "isPreview", "type": "bool"},
- }
-
- def __init__(self, *, status: Optional[Literal[1]] = None, is_preview: Optional[bool] = None, **kwargs):
- """
- :keyword status: The connector Availability Status. Default value is 1.
- :paramtype status: int
- :keyword is_preview: Set connector as preview.
- :paramtype is_preview: bool
- """
- super().__init__(**kwargs)
- self.status = status
- self.is_preview = is_preview
-
-
-class AwsCloudTrailCheckRequirements(DataConnectorsCheckRequirements):
- """Amazon Web Services CloudTrail requirements check request.
+class AWSAuthModel(CcpAuthConfig):
+ """Model for API authentication with AWS.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar role_arn: AWS STS assume role ARN. Required.
+ :vartype role_arn: str
+ :ivar external_id: AWS STS assume role external ID. This is used to prevent the confused deputy
+ problem: 'https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html'.
+ :vartype external_id: str
"""
_validation = {
- "kind": {"required": True},
+ "type": {"required": True},
+ "role_arn": {"required": True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "role_arn": {"key": "roleArn", "type": "str"},
+ "external_id": {"key": "externalId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, role_arn: str, external_id: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword role_arn: AWS STS assume role ARN. Required.
+ :paramtype role_arn: str
+ :keyword external_id: AWS STS assume role external ID. This is used to prevent the confused
+ deputy problem: 'https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html'.
+ :paramtype external_id: str
+ """
super().__init__(**kwargs)
- self.kind: str = "AmazonWebServicesCloudTrail"
+ self.type: str = "AWS"
+ self.role_arn = role_arn
+ self.external_id = external_id
class AwsCloudTrailDataConnector(DataConnector):
@@ -3815,10 +2439,10 @@ class AwsCloudTrailDataConnector(DataConnector):
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -3832,11 +2456,9 @@ class AwsCloudTrailDataConnector(DataConnector):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar aws_role_arn: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access
the Aws account.
@@ -3870,8 +2492,8 @@ def __init__(
etag: Optional[str] = None,
aws_role_arn: Optional[str] = None,
data_types: Optional["_models.AwsCloudTrailDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -3890,23 +2512,19 @@ def __init__(
class AwsCloudTrailDataConnectorDataTypes(_serialization.Model):
"""The available data types for Amazon Web Services CloudTrail data connector.
- All required parameters must be populated in order to send to Azure.
-
- :ivar logs: Logs data type. Required.
+ :ivar logs: Logs data type.
:vartype logs: ~azure.mgmt.securityinsight.models.AwsCloudTrailDataConnectorDataTypesLogs
"""
- _validation = {
- "logs": {"required": True},
- }
-
_attribute_map = {
"logs": {"key": "logs", "type": "AwsCloudTrailDataConnectorDataTypesLogs"},
}
- def __init__(self, *, logs: "_models.AwsCloudTrailDataConnectorDataTypesLogs", **kwargs):
+ def __init__(
+ self, *, logs: Optional["_models.AwsCloudTrailDataConnectorDataTypesLogs"] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword logs: Logs data type. Required.
+ :keyword logs: Logs data type.
:paramtype logs: ~azure.mgmt.securityinsight.models.AwsCloudTrailDataConnectorDataTypesLogs
"""
super().__init__(**kwargs)
@@ -3916,25 +2534,19 @@ def __init__(self, *, logs: "_models.AwsCloudTrailDataConnectorDataTypesLogs", *
class DataConnectorDataTypeCommon(_serialization.Model):
"""Common field for data type in data connectors.
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
:vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
"""
- _validation = {
- "state": {"required": True},
- }
-
_attribute_map = {
"state": {"key": "state", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(self, *, state: Optional[Union[str, "_models.DataTypeState"]] = None, **kwargs: Any) -> None:
"""
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
+ :keyword state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
:paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
"""
super().__init__(**kwargs)
@@ -3944,68 +2556,49 @@ def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
class AwsCloudTrailDataConnectorDataTypesLogs(DataConnectorDataTypeCommon):
"""Logs data type.
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
:vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
"""
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
- super().__init__(state=state, **kwargs)
-
-
-class AwsS3CheckRequirements(DataConnectorsCheckRequirements):
- """Amazon Web Services S3 requirements check request.
- All required parameters must be populated in order to send to Azure.
+class AzureDevOpsResourceInfo(_serialization.Model):
+ """Resources created in Azure DevOps repository.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
+ :ivar pipeline_id: Id of the pipeline created for the source-control.
+ :vartype pipeline_id: str
+ :ivar service_connection_id: Id of the service-connection created for the source-control.
+ :vartype service_connection_id: str
"""
- _validation = {
- "kind": {"required": True},
- }
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
+ "pipeline_id": {"key": "pipelineId", "type": "str"},
+ "service_connection_id": {"key": "serviceConnectionId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self, *, pipeline_id: Optional[str] = None, service_connection_id: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword pipeline_id: Id of the pipeline created for the source-control.
+ :paramtype pipeline_id: str
+ :keyword service_connection_id: Id of the service-connection created for the source-control.
+ :paramtype service_connection_id: str
+ """
super().__init__(**kwargs)
- self.kind: str = "AmazonWebServicesS3"
+ self.pipeline_id = pipeline_id
+ self.service_connection_id = service_connection_id
-class AwsS3DataConnector(DataConnector):
- """Represents Amazon Web Services S3 data connector.
+class AzureResourceEntity(Entity):
+ """Represents an azure resource entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -4015,24 +2608,21 @@ class AwsS3DataConnector(DataConnector):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar destination_table: The logs destination table name in LogAnalytics.
- :vartype destination_table: str
- :ivar sqs_urls: The AWS sqs urls for the connector.
- :vartype sqs_urls: list[str]
- :ivar role_arn: The Aws Role Arn that is used to access the Aws account.
- :vartype role_arn: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AwsS3DataConnectorDataTypes
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar resource_id: The azure resource id of the resource.
+ :vartype resource_id: str
+ :ivar subscription_id: The subscription id of the resource.
+ :vartype subscription_id: str
"""
_validation = {
@@ -4041,6 +2631,10 @@ class AwsS3DataConnector(DataConnector):
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "resource_id": {"readonly": True},
+ "subscription_id": {"readonly": True},
}
_attribute_map = {
@@ -4048,237 +2642,107 @@ class AwsS3DataConnector(DataConnector):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "destination_table": {"key": "properties.destinationTable", "type": "str"},
- "sqs_urls": {"key": "properties.sqsUrls", "type": "[str]"},
- "role_arn": {"key": "properties.roleArn", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "AwsS3DataConnectorDataTypes"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "resource_id": {"key": "properties.resourceId", "type": "str"},
+ "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- destination_table: Optional[str] = None,
- sqs_urls: Optional[List[str]] = None,
- role_arn: Optional[str] = None,
- data_types: Optional["_models.AwsS3DataConnectorDataTypes"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword destination_table: The logs destination table name in LogAnalytics.
- :paramtype destination_table: str
- :keyword sqs_urls: The AWS sqs urls for the connector.
- :paramtype sqs_urls: list[str]
- :keyword role_arn: The Aws Role Arn that is used to access the Aws account.
- :paramtype role_arn: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AwsS3DataConnectorDataTypes
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "AmazonWebServicesS3"
- self.destination_table = destination_table
- self.sqs_urls = sqs_urls
- self.role_arn = role_arn
- self.data_types = data_types
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.kind: str = "AzureResource"
+ self.additional_data = None
+ self.friendly_name = None
+ self.resource_id = None
+ self.subscription_id = None
-class AwsS3DataConnectorDataTypes(_serialization.Model):
- """The available data types for Amazon Web Services S3 data connector.
+class AzureResourceEntityProperties(EntityCommonProperties):
+ """AzureResource entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar logs: Logs data type. Required.
- :vartype logs: ~azure.mgmt.securityinsight.models.AwsS3DataConnectorDataTypesLogs
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar resource_id: The azure resource id of the resource.
+ :vartype resource_id: str
+ :ivar subscription_id: The subscription id of the resource.
+ :vartype subscription_id: str
"""
_validation = {
- "logs": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "resource_id": {"readonly": True},
+ "subscription_id": {"readonly": True},
}
_attribute_map = {
- "logs": {"key": "logs", "type": "AwsS3DataConnectorDataTypesLogs"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "resource_id": {"key": "resourceId", "type": "str"},
+ "subscription_id": {"key": "subscriptionId", "type": "str"},
}
- def __init__(self, *, logs: "_models.AwsS3DataConnectorDataTypesLogs", **kwargs):
- """
- :keyword logs: Logs data type. Required.
- :paramtype logs: ~azure.mgmt.securityinsight.models.AwsS3DataConnectorDataTypesLogs
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.logs = logs
-
-
-class AwsS3DataConnectorDataTypesLogs(DataConnectorDataTypeCommon):
- """Logs data type.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
-
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
- super().__init__(state=state, **kwargs)
-
-
-class AzureDevOpsResourceInfo(_serialization.Model):
- """Resources created in Azure DevOps repository.
-
- :ivar pipeline_id: Id of the pipeline created for the source-control.
- :vartype pipeline_id: str
- :ivar service_connection_id: Id of the service-connection created for the source-control.
- :vartype service_connection_id: str
- """
-
- _attribute_map = {
- "pipeline_id": {"key": "pipelineId", "type": "str"},
- "service_connection_id": {"key": "serviceConnectionId", "type": "str"},
- }
-
- def __init__(self, *, pipeline_id: Optional[str] = None, service_connection_id: Optional[str] = None, **kwargs):
- """
- :keyword pipeline_id: Id of the pipeline created for the source-control.
- :paramtype pipeline_id: str
- :keyword service_connection_id: Id of the service-connection created for the source-control.
- :paramtype service_connection_id: str
- """
- super().__init__(**kwargs)
- self.pipeline_id = pipeline_id
- self.service_connection_id = service_connection_id
-
-
-class AzureResourceEntity(Entity):
- """Represents an azure resource entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar resource_id: The azure resource id of the resource.
- :vartype resource_id: str
- :ivar subscription_id: The subscription id of the resource.
- :vartype subscription_id: str
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "resource_id": {"readonly": True},
- "subscription_id": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "resource_id": {"key": "properties.resourceId", "type": "str"},
- "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "AzureResource"
- self.additional_data = None
- self.friendly_name = None
self.resource_id = None
self.subscription_id = None
-class AzureResourceEntityProperties(EntityCommonProperties):
- """AzureResource entity property bag.
+class BasicAuthModel(CcpAuthConfig):
+ """Model for API authentication with basic flow - user name + password.
- 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 server.
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar resource_id: The azure resource id of the resource.
- :vartype resource_id: str
- :ivar subscription_id: The subscription id of the resource.
- :vartype subscription_id: str
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar user_name: The user name. Required.
+ :vartype user_name: str
+ :ivar password: The password. Required.
+ :vartype password: str
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "resource_id": {"readonly": True},
- "subscription_id": {"readonly": True},
+ "type": {"required": True},
+ "user_name": {"required": True},
+ "password": {"required": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "resource_id": {"key": "resourceId", "type": "str"},
- "subscription_id": {"key": "subscriptionId", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "user_name": {"key": "userName", "type": "str"},
+ "password": {"key": "password", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, user_name: str, password: str, **kwargs: Any) -> None:
+ """
+ :keyword user_name: The user name. Required.
+ :paramtype user_name: str
+ :keyword password: The password. Required.
+ :paramtype password: str
+ """
super().__init__(**kwargs)
- self.resource_id = None
- self.subscription_id = None
+ self.type: str = "Basic"
+ self.user_name = user_name
+ self.password = password
-class Bookmark(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+class Bookmark(ResourceWithEtag):
"""Represents a bookmark in Azure Security Insights.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -4316,12 +2780,6 @@ class Bookmark(ResourceWithEtag): # pylint: disable=too-many-instance-attribute
:vartype query_end_time: ~datetime.datetime
:ivar incident_info: Describes an incident that relates to bookmark.
:vartype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
- :ivar entity_mappings: Describes the entity mappings of the bookmark.
- :vartype entity_mappings: list[~azure.mgmt.securityinsight.models.BookmarkEntityMappings]
- :ivar tactics: A list of relevant mitre attacks.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: A list of relevant mitre techniques.
- :vartype techniques: list[str]
"""
_validation = {
@@ -4350,9 +2808,6 @@ class Bookmark(ResourceWithEtag): # pylint: disable=too-many-instance-attribute
"query_start_time": {"key": "properties.queryStartTime", "type": "iso-8601"},
"query_end_time": {"key": "properties.queryEndTime", "type": "iso-8601"},
"incident_info": {"key": "properties.incidentInfo", "type": "IncidentInfo"},
- "entity_mappings": {"key": "properties.entityMappings", "type": "[BookmarkEntityMappings]"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
}
def __init__(
@@ -4372,11 +2827,8 @@ def __init__(
query_start_time: Optional[datetime.datetime] = None,
query_end_time: Optional[datetime.datetime] = None,
incident_info: Optional["_models.IncidentInfo"] = None,
- entity_mappings: Optional[List["_models.BookmarkEntityMappings"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -4406,12 +2858,6 @@ def __init__(
:paramtype query_end_time: ~datetime.datetime
:keyword incident_info: Describes an incident that relates to bookmark.
:paramtype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
- :keyword entity_mappings: Describes the entity mappings of the bookmark.
- :paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.BookmarkEntityMappings]
- :keyword tactics: A list of relevant mitre attacks.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: A list of relevant mitre techniques.
- :paramtype techniques: list[str]
"""
super().__init__(etag=etag, **kwargs)
self.created = created
@@ -4427,331 +2873,222 @@ def __init__(
self.query_start_time = query_start_time
self.query_end_time = query_end_time
self.incident_info = incident_info
- self.entity_mappings = entity_mappings
- self.tactics = tactics
- self.techniques = techniques
-class BookmarkEntityMappings(_serialization.Model):
- """Describes the entity mappings of a single entity.
+class BookmarkList(_serialization.Model):
+ """List all the bookmarks.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar entity_type: The entity type.
- :vartype entity_type: str
- :ivar field_mappings: Array of fields mapping for that entity type.
- :vartype field_mappings: list[~azure.mgmt.securityinsight.models.EntityFieldMapping]
+ All required parameters must be populated in order to send to server.
+
+ :ivar next_link: URL to fetch the next set of cases.
+ :vartype next_link: str
+ :ivar value: Array of bookmarks. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Bookmark]
"""
+ _validation = {
+ "next_link": {"readonly": True},
+ "value": {"required": True},
+ }
+
_attribute_map = {
- "entity_type": {"key": "entityType", "type": "str"},
- "field_mappings": {"key": "fieldMappings", "type": "[EntityFieldMapping]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Bookmark]"},
}
- def __init__(
- self,
- *,
- entity_type: Optional[str] = None,
- field_mappings: Optional[List["_models.EntityFieldMapping"]] = None,
- **kwargs
- ):
+ def __init__(self, *, value: List["_models.Bookmark"], **kwargs: Any) -> None:
"""
- :keyword entity_type: The entity type.
- :paramtype entity_type: str
- :keyword field_mappings: Array of fields mapping for that entity type.
- :paramtype field_mappings: list[~azure.mgmt.securityinsight.models.EntityFieldMapping]
+ :keyword value: Array of bookmarks. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Bookmark]
"""
super().__init__(**kwargs)
- self.entity_type = entity_type
- self.field_mappings = field_mappings
+ self.next_link = None
+ self.value = value
+
+class BooleanConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that applies a boolean operator (e.g AND, OR) to
+ conditions.
-class BookmarkExpandParameters(_serialization.Model):
- """The parameters required to execute an expand operation on the given bookmark.
+ All required parameters must be populated in order to send to server.
- :ivar end_time: The end date filter, so the only expansion results returned are before this
- date.
- :vartype end_time: ~datetime.datetime
- :ivar expansion_id: The Id of the expansion to perform.
- :vartype expansion_id: str
- :ivar start_time: The start date filter, so the only expansion results returned are after this
- date.
- :vartype start_time: ~datetime.datetime
+ :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
+ "PropertyChanged", "PropertyArrayChanged", and "Boolean".
+ :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
+ :ivar condition_properties: Describes an automation rule condition with boolean operators.
+ :vartype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRuleBooleanCondition
"""
+ _validation = {
+ "condition_type": {"required": True},
+ }
+
_attribute_map = {
- "end_time": {"key": "endTime", "type": "iso-8601"},
- "expansion_id": {"key": "expansionId", "type": "str"},
- "start_time": {"key": "startTime", "type": "iso-8601"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRuleBooleanCondition"},
}
def __init__(
- self,
- *,
- end_time: Optional[datetime.datetime] = None,
- expansion_id: Optional[str] = None,
- start_time: Optional[datetime.datetime] = None,
- **kwargs
- ):
- """
- :keyword end_time: The end date filter, so the only expansion results returned are before this
- date.
- :paramtype end_time: ~datetime.datetime
- :keyword expansion_id: The Id of the expansion to perform.
- :paramtype expansion_id: str
- :keyword start_time: The start date filter, so the only expansion results returned are after
- this date.
- :paramtype start_time: ~datetime.datetime
+ self, *, condition_properties: Optional["_models.AutomationRuleBooleanCondition"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword condition_properties: Describes an automation rule condition with boolean operators.
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRuleBooleanCondition
"""
super().__init__(**kwargs)
- self.end_time = end_time
- self.expansion_id = expansion_id
- self.start_time = start_time
+ self.condition_type: str = "Boolean"
+ self.condition_properties = condition_properties
+
+class CcpResponseConfig(_serialization.Model):
+ """A custom response configuration for a rule.
-class BookmarkExpandResponse(_serialization.Model):
- """The entity expansion result operation response.
+ All required parameters must be populated in order to send to server.
- :ivar meta_data: The metadata from the expansion operation results.
- :vartype meta_data: ~azure.mgmt.securityinsight.models.ExpansionResultsMetadata
- :ivar value: The expansion result values.
- :vartype value: ~azure.mgmt.securityinsight.models.BookmarkExpandResponseValue
+ :ivar events_json_paths: The json paths, '$' char is the json root. Required.
+ :vartype events_json_paths: list[str]
+ :ivar success_status_json_path: The value where the status message/code should appear in the
+ response.
+ :vartype success_status_json_path: str
+ :ivar success_status_value: The status value.
+ :vartype success_status_value: str
+ :ivar is_gzip_compressed: The value indicating whether the remote server support Gzip and we
+ should expect Gzip response.
+ :vartype is_gzip_compressed: bool
+ :ivar compression_algo: The compression algorithm. For Example: 'gzip', 'multi-gzip',
+ 'deflate'.
+ :vartype compression_algo: str
+ :ivar format: The response format. possible values are json,csv,xml.
+ :vartype format: str
+ :ivar csv_delimiter: The csv delimiter, in case the response format is CSV.
+ :vartype csv_delimiter: str
+ :ivar has_csv_boundary: The value indicating whether the response has CSV boundary in case the
+ response in CSV format.
+ :vartype has_csv_boundary: bool
+ :ivar has_csv_header: The value indicating whether the response has headers in case the
+ response in CSV format.
+ :vartype has_csv_header: bool
+ :ivar convert_child_properties_to_array: The value indicating whether the response isn't an
+ array of events / logs. By setting this flag to true it means the remote server will response
+ with an object which each property has as a value an array of events / logs.
+ :vartype convert_child_properties_to_array: bool
+ :ivar csv_escape: The character used to escape characters in CSV.
+ :vartype csv_escape: str
"""
+ _validation = {
+ "events_json_paths": {"required": True},
+ "csv_escape": {"max_length": 1, "min_length": 1},
+ }
+
_attribute_map = {
- "meta_data": {"key": "metaData", "type": "ExpansionResultsMetadata"},
- "value": {"key": "value", "type": "BookmarkExpandResponseValue"},
+ "events_json_paths": {"key": "eventsJsonPaths", "type": "[str]"},
+ "success_status_json_path": {"key": "successStatusJsonPath", "type": "str"},
+ "success_status_value": {"key": "successStatusValue", "type": "str"},
+ "is_gzip_compressed": {"key": "isGzipCompressed", "type": "bool"},
+ "compression_algo": {"key": "compressionAlgo", "type": "str"},
+ "format": {"key": "format", "type": "str"},
+ "csv_delimiter": {"key": "csvDelimiter", "type": "str"},
+ "has_csv_boundary": {"key": "hasCsvBoundary", "type": "bool"},
+ "has_csv_header": {"key": "hasCsvHeader", "type": "bool"},
+ "convert_child_properties_to_array": {"key": "convertChildPropertiesToArray", "type": "bool"},
+ "csv_escape": {"key": "csvEscape", "type": "str"},
}
def __init__(
self,
*,
- meta_data: Optional["_models.ExpansionResultsMetadata"] = None,
- value: Optional["_models.BookmarkExpandResponseValue"] = None,
- **kwargs
- ):
- """
- :keyword meta_data: The metadata from the expansion operation results.
- :paramtype meta_data: ~azure.mgmt.securityinsight.models.ExpansionResultsMetadata
- :keyword value: The expansion result values.
- :paramtype value: ~azure.mgmt.securityinsight.models.BookmarkExpandResponseValue
+ events_json_paths: List[str],
+ success_status_json_path: Optional[str] = None,
+ success_status_value: Optional[str] = None,
+ is_gzip_compressed: Optional[bool] = None,
+ compression_algo: str = "gzip",
+ format: str = "json",
+ csv_delimiter: Optional[str] = None,
+ has_csv_boundary: Optional[bool] = None,
+ has_csv_header: Optional[bool] = None,
+ convert_child_properties_to_array: Optional[bool] = None,
+ csv_escape: str = '"',
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword events_json_paths: The json paths, '$' char is the json root. Required.
+ :paramtype events_json_paths: list[str]
+ :keyword success_status_json_path: The value where the status message/code should appear in the
+ response.
+ :paramtype success_status_json_path: str
+ :keyword success_status_value: The status value.
+ :paramtype success_status_value: str
+ :keyword is_gzip_compressed: The value indicating whether the remote server support Gzip and we
+ should expect Gzip response.
+ :paramtype is_gzip_compressed: bool
+ :keyword compression_algo: The compression algorithm. For Example: 'gzip', 'multi-gzip',
+ 'deflate'.
+ :paramtype compression_algo: str
+ :keyword format: The response format. possible values are json,csv,xml.
+ :paramtype format: str
+ :keyword csv_delimiter: The csv delimiter, in case the response format is CSV.
+ :paramtype csv_delimiter: str
+ :keyword has_csv_boundary: The value indicating whether the response has CSV boundary in case
+ the response in CSV format.
+ :paramtype has_csv_boundary: bool
+ :keyword has_csv_header: The value indicating whether the response has headers in case the
+ response in CSV format.
+ :paramtype has_csv_header: bool
+ :keyword convert_child_properties_to_array: The value indicating whether the response isn't an
+ array of events / logs. By setting this flag to true it means the remote server will response
+ with an object which each property has as a value an array of events / logs.
+ :paramtype convert_child_properties_to_array: bool
+ :keyword csv_escape: The character used to escape characters in CSV.
+ :paramtype csv_escape: str
"""
super().__init__(**kwargs)
- self.meta_data = meta_data
- self.value = value
+ self.events_json_paths = events_json_paths
+ self.success_status_json_path = success_status_json_path
+ self.success_status_value = success_status_value
+ self.is_gzip_compressed = is_gzip_compressed
+ self.compression_algo = compression_algo
+ self.format = format
+ self.csv_delimiter = csv_delimiter
+ self.has_csv_boundary = has_csv_boundary
+ self.has_csv_header = has_csv_header
+ self.convert_child_properties_to_array = convert_child_properties_to_array
+ self.csv_escape = csv_escape
-class BookmarkExpandResponseValue(_serialization.Model):
- """The expansion result values.
+class ClientInfo(_serialization.Model):
+ """Information on the client (user or application) that made some action.
- :ivar entities: Array of the expansion result entities.
- :vartype entities: list[~azure.mgmt.securityinsight.models.Entity]
- :ivar edges: Array of expansion result connected entities.
- :vartype edges: list[~azure.mgmt.securityinsight.models.ConnectedEntity]
+ :ivar email: The email of the client.
+ :vartype email: str
+ :ivar name: The name of the client.
+ :vartype name: str
+ :ivar object_id: The object id of the client.
+ :vartype object_id: str
+ :ivar user_principal_name: The user principal name of the client.
+ :vartype user_principal_name: str
"""
_attribute_map = {
- "entities": {"key": "entities", "type": "[Entity]"},
- "edges": {"key": "edges", "type": "[ConnectedEntity]"},
+ "email": {"key": "email", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "object_id": {"key": "objectId", "type": "str"},
+ "user_principal_name": {"key": "userPrincipalName", "type": "str"},
}
def __init__(
self,
*,
- entities: Optional[List["_models.Entity"]] = None,
- edges: Optional[List["_models.ConnectedEntity"]] = None,
- **kwargs
- ):
- """
- :keyword entities: Array of the expansion result entities.
- :paramtype entities: list[~azure.mgmt.securityinsight.models.Entity]
- :keyword edges: Array of expansion result connected entities.
- :paramtype edges: list[~azure.mgmt.securityinsight.models.ConnectedEntity]
- """
- super().__init__(**kwargs)
- self.entities = entities
- self.edges = edges
-
-
-class BookmarkList(_serialization.Model):
- """List all the bookmarks.
-
- 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 next_link: URL to fetch the next set of bookmarks.
- :vartype next_link: str
- :ivar value: Array of bookmarks. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Bookmark]
- """
-
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Bookmark]"},
- }
-
- def __init__(self, *, value: List["_models.Bookmark"], **kwargs):
- """
- :keyword value: Array of bookmarks. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Bookmark]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class BookmarkTimelineItem(EntityTimelineItem):
- """Represents bookmark timeline item.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: The entity query kind type. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- :ivar azure_resource_id: The bookmark azure resource id. Required.
- :vartype azure_resource_id: str
- :ivar display_name: The bookmark display name.
- :vartype display_name: str
- :ivar notes: The notes of the bookmark.
- :vartype notes: str
- :ivar end_time_utc: The bookmark end time.
- :vartype end_time_utc: ~datetime.datetime
- :ivar start_time_utc: The bookmark start time.
- :vartype start_time_utc: ~datetime.datetime
- :ivar event_time: The bookmark event time.
- :vartype event_time: ~datetime.datetime
- :ivar created_by: Describes a user that created the bookmark.
- :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
- :ivar labels: List of labels relevant to this bookmark.
- :vartype labels: list[str]
- """
-
- _validation = {
- "kind": {"required": True},
- "azure_resource_id": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "azure_resource_id": {"key": "azureResourceId", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "notes": {"key": "notes", "type": "str"},
- "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"},
- "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"},
- "event_time": {"key": "eventTime", "type": "iso-8601"},
- "created_by": {"key": "createdBy", "type": "UserInfo"},
- "labels": {"key": "labels", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- azure_resource_id: str,
- display_name: Optional[str] = None,
- notes: Optional[str] = None,
- end_time_utc: Optional[datetime.datetime] = None,
- start_time_utc: Optional[datetime.datetime] = None,
- event_time: Optional[datetime.datetime] = None,
- created_by: Optional["_models.UserInfo"] = None,
- labels: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword azure_resource_id: The bookmark azure resource id. Required.
- :paramtype azure_resource_id: str
- :keyword display_name: The bookmark display name.
- :paramtype display_name: str
- :keyword notes: The notes of the bookmark.
- :paramtype notes: str
- :keyword end_time_utc: The bookmark end time.
- :paramtype end_time_utc: ~datetime.datetime
- :keyword start_time_utc: The bookmark start time.
- :paramtype start_time_utc: ~datetime.datetime
- :keyword event_time: The bookmark event time.
- :paramtype event_time: ~datetime.datetime
- :keyword created_by: Describes a user that created the bookmark.
- :paramtype created_by: ~azure.mgmt.securityinsight.models.UserInfo
- :keyword labels: List of labels relevant to this bookmark.
- :paramtype labels: list[str]
- """
- super().__init__(**kwargs)
- self.kind: str = "Bookmark"
- self.azure_resource_id = azure_resource_id
- self.display_name = display_name
- self.notes = notes
- self.end_time_utc = end_time_utc
- self.start_time_utc = start_time_utc
- self.event_time = event_time
- self.created_by = created_by
- self.labels = labels
-
-
-class BooleanConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that applies a boolean operator (e.g AND, OR) to conditions.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
- "PropertyChanged", "PropertyArrayChanged", and "Boolean".
- :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
- :ivar condition_properties:
- :vartype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRuleBooleanCondition
- """
-
- _validation = {
- "condition_type": {"required": True},
- }
-
- _attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRuleBooleanCondition"},
- }
-
- def __init__(self, *, condition_properties: Optional["_models.AutomationRuleBooleanCondition"] = None, **kwargs):
- """
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRuleBooleanCondition
- """
- super().__init__(**kwargs)
- self.condition_type: str = "Boolean"
- self.condition_properties = condition_properties
-
-
-class ClientInfo(_serialization.Model):
- """Information on the client (user or application) that made some action.
-
- :ivar email: The email of the client.
- :vartype email: str
- :ivar name: The name of the client.
- :vartype name: str
- :ivar object_id: The object id of the client.
- :vartype object_id: str
- :ivar user_principal_name: The user principal name of the client.
- :vartype user_principal_name: str
- """
-
- _attribute_map = {
- "email": {"key": "email", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "object_id": {"key": "objectId", "type": "str"},
- "user_principal_name": {"key": "userPrincipalName", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- email: Optional[str] = None,
- name: Optional[str] = None,
- object_id: Optional[str] = None,
- user_principal_name: Optional[str] = None,
- **kwargs
- ):
+ email: Optional[str] = None,
+ name: Optional[str] = None,
+ object_id: Optional[str] = None,
+ user_principal_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword email: The email of the client.
:paramtype email: str
@@ -4774,10 +3111,10 @@ class CloudApplicationEntity(Entity):
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -4790,8 +3127,8 @@ class CloudApplicationEntity(Entity):
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -4833,7 +3170,7 @@ class CloudApplicationEntity(Entity):
"instance_name": {"key": "properties.instanceName", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: str = "CloudApplication"
@@ -4880,7 +3217,7 @@ class CloudApplicationEntityProperties(EntityCommonProperties):
"instance_name": {"key": "instanceName", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.app_id = None
@@ -4911,625 +3248,483 @@ class CloudErrorBody(_serialization.Model):
"message": {"key": "message", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.code = None
self.message = None
-class CodelessApiPollingDataConnector(DataConnector):
- """Represents Codeless API Polling data connector.
+class ConnectivityCriterion(_serialization.Model):
+ """The criteria by which we determine whether the connector is connected or not.
+ For Example, use a KQL query to check if the expected data type is flowing).
- 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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
+ :ivar type: Gets or sets the type of connectivity. Required.
:vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar connector_ui_config: Config to describe the instructions blade.
- :vartype connector_ui_config:
- ~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigProperties
- :ivar polling_config: Config to describe the polling instructions.
- :vartype polling_config:
- ~azure.mgmt.securityinsight.models.CodelessConnectorPollingConfigProperties
+ :ivar value: Gets or sets the queries for checking connectivity.
+ :vartype value: list[str]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ "type": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "connector_ui_config": {"key": "properties.connectorUiConfig", "type": "CodelessUiConnectorConfigProperties"},
- "polling_config": {"key": "properties.pollingConfig", "type": "CodelessConnectorPollingConfigProperties"},
+ "value": {"key": "value", "type": "[str]"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- connector_ui_config: Optional["_models.CodelessUiConnectorConfigProperties"] = None,
- polling_config: Optional["_models.CodelessConnectorPollingConfigProperties"] = None,
- **kwargs
- ):
+ def __init__(self, *, type: str, value: Optional[List[str]] = None, **kwargs: Any) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword connector_ui_config: Config to describe the instructions blade.
- :paramtype connector_ui_config:
- ~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigProperties
- :keyword polling_config: Config to describe the polling instructions.
- :paramtype polling_config:
- ~azure.mgmt.securityinsight.models.CodelessConnectorPollingConfigProperties
+ :keyword type: Gets or sets the type of connectivity. Required.
+ :paramtype type: str
+ :keyword value: Gets or sets the queries for checking connectivity.
+ :paramtype value: list[str]
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "APIPolling"
- self.connector_ui_config = connector_ui_config
- self.polling_config = polling_config
+ super().__init__(**kwargs)
+ self.type = type
+ self.value = value
-class CodelessConnectorPollingAuthProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Describe the authentication properties needed to successfully authenticate with the server.
+class ConnectorDataType(_serialization.Model):
+ """The data type which is created by the connector,
+ including a query indicated when was the last time that data type was received in the
+ workspace.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar auth_type: The authentication type. Required.
- :vartype auth_type: str
- :ivar api_key_name: The header name which the token is sent with.
- :vartype api_key_name: str
- :ivar api_key_identifier: A prefix send in the header before the actual token.
- :vartype api_key_identifier: str
- :ivar is_api_key_in_post_payload: Marks if the key should sent in header.
- :vartype is_api_key_in_post_payload: str
- :ivar flow_name: Describes the flow name, for example 'AuthCode' for Oauth 2.0.
- :vartype flow_name: str
- :ivar token_endpoint: The endpoint used to issue a token, used in Oauth 2.0 flow.
- :vartype token_endpoint: str
- :ivar authorization_endpoint: The endpoint used to authorize the user, used in Oauth 2.0 flow.
- :vartype authorization_endpoint: str
- :ivar authorization_endpoint_query_parameters: The query parameters used in authorization
- request, used in Oauth 2.0 flow.
- :vartype authorization_endpoint_query_parameters: JSON
- :ivar redirection_endpoint: The redirect endpoint where we will get the authorization code,
- used in Oauth 2.0 flow.
- :vartype redirection_endpoint: str
- :ivar token_endpoint_headers: The query headers used in token request, used in Oauth 2.0 flow.
- :vartype token_endpoint_headers: JSON
- :ivar token_endpoint_query_parameters: The query parameters used in token request, used in
- Oauth 2.0 flow.
- :vartype token_endpoint_query_parameters: JSON
- :ivar is_client_secret_in_header: Marks if we should send the client secret in header or
- payload, used in Oauth 2.0 flow.
- :vartype is_client_secret_in_header: bool
- :ivar scope: The OAuth token scope.
- :vartype scope: str
+ :ivar name: Gets or sets the name of the data type to show in the graph. Required.
+ :vartype name: str
+ :ivar last_data_received_query: Gets or sets the query to indicate when relevant data was last
+ received in the workspace. Required.
+ :vartype last_data_received_query: str
"""
_validation = {
- "auth_type": {"required": True},
+ "name": {"required": True},
+ "last_data_received_query": {"required": True},
}
_attribute_map = {
- "auth_type": {"key": "authType", "type": "str"},
- "api_key_name": {"key": "apiKeyName", "type": "str"},
- "api_key_identifier": {"key": "apiKeyIdentifier", "type": "str"},
- "is_api_key_in_post_payload": {"key": "isApiKeyInPostPayload", "type": "str"},
- "flow_name": {"key": "flowName", "type": "str"},
- "token_endpoint": {"key": "tokenEndpoint", "type": "str"},
- "authorization_endpoint": {"key": "authorizationEndpoint", "type": "str"},
- "authorization_endpoint_query_parameters": {"key": "authorizationEndpointQueryParameters", "type": "object"},
- "redirection_endpoint": {"key": "redirectionEndpoint", "type": "str"},
- "token_endpoint_headers": {"key": "tokenEndpointHeaders", "type": "object"},
- "token_endpoint_query_parameters": {"key": "tokenEndpointQueryParameters", "type": "object"},
- "is_client_secret_in_header": {"key": "isClientSecretInHeader", "type": "bool"},
- "scope": {"key": "scope", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "last_data_received_query": {"key": "lastDataReceivedQuery", "type": "str"},
}
- def __init__(
- self,
- *,
- auth_type: str,
- api_key_name: Optional[str] = None,
- api_key_identifier: Optional[str] = None,
- is_api_key_in_post_payload: Optional[str] = None,
- flow_name: Optional[str] = None,
- token_endpoint: Optional[str] = None,
- authorization_endpoint: Optional[str] = None,
- authorization_endpoint_query_parameters: Optional[JSON] = None,
- redirection_endpoint: Optional[str] = None,
- token_endpoint_headers: Optional[JSON] = None,
- token_endpoint_query_parameters: Optional[JSON] = None,
- is_client_secret_in_header: Optional[bool] = None,
- scope: Optional[str] = None,
- **kwargs
- ):
+ def __init__(self, *, name: str, last_data_received_query: str, **kwargs: Any) -> None:
"""
- :keyword auth_type: The authentication type. Required.
- :paramtype auth_type: str
- :keyword api_key_name: The header name which the token is sent with.
- :paramtype api_key_name: str
- :keyword api_key_identifier: A prefix send in the header before the actual token.
- :paramtype api_key_identifier: str
- :keyword is_api_key_in_post_payload: Marks if the key should sent in header.
- :paramtype is_api_key_in_post_payload: str
- :keyword flow_name: Describes the flow name, for example 'AuthCode' for Oauth 2.0.
- :paramtype flow_name: str
- :keyword token_endpoint: The endpoint used to issue a token, used in Oauth 2.0 flow.
- :paramtype token_endpoint: str
- :keyword authorization_endpoint: The endpoint used to authorize the user, used in Oauth 2.0
- flow.
- :paramtype authorization_endpoint: str
- :keyword authorization_endpoint_query_parameters: The query parameters used in authorization
- request, used in Oauth 2.0 flow.
- :paramtype authorization_endpoint_query_parameters: JSON
- :keyword redirection_endpoint: The redirect endpoint where we will get the authorization code,
- used in Oauth 2.0 flow.
- :paramtype redirection_endpoint: str
- :keyword token_endpoint_headers: The query headers used in token request, used in Oauth 2.0
- flow.
- :paramtype token_endpoint_headers: JSON
- :keyword token_endpoint_query_parameters: The query parameters used in token request, used in
- Oauth 2.0 flow.
- :paramtype token_endpoint_query_parameters: JSON
- :keyword is_client_secret_in_header: Marks if we should send the client secret in header or
- payload, used in Oauth 2.0 flow.
- :paramtype is_client_secret_in_header: bool
- :keyword scope: The OAuth token scope.
- :paramtype scope: str
+ :keyword name: Gets or sets the name of the data type to show in the graph. Required.
+ :paramtype name: str
+ :keyword last_data_received_query: Gets or sets the query to indicate when relevant data was
+ last received in the workspace. Required.
+ :paramtype last_data_received_query: str
"""
super().__init__(**kwargs)
- self.auth_type = auth_type
- self.api_key_name = api_key_name
- self.api_key_identifier = api_key_identifier
- self.is_api_key_in_post_payload = is_api_key_in_post_payload
- self.flow_name = flow_name
- self.token_endpoint = token_endpoint
- self.authorization_endpoint = authorization_endpoint
- self.authorization_endpoint_query_parameters = authorization_endpoint_query_parameters
- self.redirection_endpoint = redirection_endpoint
- self.token_endpoint_headers = token_endpoint_headers
- self.token_endpoint_query_parameters = token_endpoint_query_parameters
- self.is_client_secret_in_header = is_client_secret_in_header
- self.scope = scope
-
+ self.name = name
+ self.last_data_received_query = last_data_received_query
-class CodelessConnectorPollingConfigProperties(_serialization.Model):
- """Config to describe the polling config for API poller connector.
- All required parameters must be populated in order to send to Azure.
+class ConnectorDefinitionsAvailability(_serialization.Model):
+ """The exposure status of the connector to the customers.
- :ivar is_active: The poller active status.
- :vartype is_active: bool
- :ivar auth: Describe the authentication type of the poller. Required.
- :vartype auth: ~azure.mgmt.securityinsight.models.CodelessConnectorPollingAuthProperties
- :ivar request: Describe the poll request config parameters of the poller. Required.
- :vartype request: ~azure.mgmt.securityinsight.models.CodelessConnectorPollingRequestProperties
- :ivar paging: Describe the poll request paging config of the poller.
- :vartype paging: ~azure.mgmt.securityinsight.models.CodelessConnectorPollingPagingProperties
- :ivar response: Describe the response config parameters of the poller.
- :vartype response:
- ~azure.mgmt.securityinsight.models.CodelessConnectorPollingResponseProperties
+ :ivar status: The exposure status of the connector to the customers. Available values are 0-4
+ (0=None, 1=Available, 2=FeatureFlag, 3=Internal).
+ :vartype status: int
+ :ivar is_preview: Gets or sets a value indicating whether the connector is preview.
+ :vartype is_preview: bool
"""
- _validation = {
- "auth": {"required": True},
- "request": {"required": True},
+ _attribute_map = {
+ "status": {"key": "status", "type": "int"},
+ "is_preview": {"key": "isPreview", "type": "bool"},
}
+ def __init__(self, *, status: Optional[int] = None, is_preview: Optional[bool] = None, **kwargs: Any) -> None:
+ """
+ :keyword status: The exposure status of the connector to the customers. Available values are
+ 0-4 (0=None, 1=Available, 2=FeatureFlag, 3=Internal).
+ :paramtype status: int
+ :keyword is_preview: Gets or sets a value indicating whether the connector is preview.
+ :paramtype is_preview: bool
+ """
+ super().__init__(**kwargs)
+ self.status = status
+ self.is_preview = is_preview
+
+
+class ConnectorDefinitionsPermissions(_serialization.Model):
+ """The required Permissions for the connector.
+
+ :ivar tenant: Gets or sets the required tenant permissions for the connector.
+ :vartype tenant: list[str]
+ :ivar licenses: Gets or sets the required licenses for the user to create connections.
+ :vartype licenses: list[str]
+ :ivar resource_provider: Gets or sets the resource provider permissions required for the user
+ to create connections.
+ :vartype resource_provider:
+ list[~azure.mgmt.securityinsight.models.ConnectorDefinitionsResourceProvider]
+ :ivar customs: Gets or sets the customs permissions required for the user to create
+ connections.
+ :vartype customs: list[~azure.mgmt.securityinsight.models.CustomPermissionDetails]
+ """
+
_attribute_map = {
- "is_active": {"key": "isActive", "type": "bool"},
- "auth": {"key": "auth", "type": "CodelessConnectorPollingAuthProperties"},
- "request": {"key": "request", "type": "CodelessConnectorPollingRequestProperties"},
- "paging": {"key": "paging", "type": "CodelessConnectorPollingPagingProperties"},
- "response": {"key": "response", "type": "CodelessConnectorPollingResponseProperties"},
+ "tenant": {"key": "tenant", "type": "[str]"},
+ "licenses": {"key": "licenses", "type": "[str]"},
+ "resource_provider": {"key": "resourceProvider", "type": "[ConnectorDefinitionsResourceProvider]"},
+ "customs": {"key": "customs", "type": "[CustomPermissionDetails]"},
}
def __init__(
self,
*,
- auth: "_models.CodelessConnectorPollingAuthProperties",
- request: "_models.CodelessConnectorPollingRequestProperties",
- is_active: Optional[bool] = None,
- paging: Optional["_models.CodelessConnectorPollingPagingProperties"] = None,
- response: Optional["_models.CodelessConnectorPollingResponseProperties"] = None,
- **kwargs
- ):
- """
- :keyword is_active: The poller active status.
- :paramtype is_active: bool
- :keyword auth: Describe the authentication type of the poller. Required.
- :paramtype auth: ~azure.mgmt.securityinsight.models.CodelessConnectorPollingAuthProperties
- :keyword request: Describe the poll request config parameters of the poller. Required.
- :paramtype request:
- ~azure.mgmt.securityinsight.models.CodelessConnectorPollingRequestProperties
- :keyword paging: Describe the poll request paging config of the poller.
- :paramtype paging: ~azure.mgmt.securityinsight.models.CodelessConnectorPollingPagingProperties
- :keyword response: Describe the response config parameters of the poller.
- :paramtype response:
- ~azure.mgmt.securityinsight.models.CodelessConnectorPollingResponseProperties
+ tenant: Optional[List[str]] = None,
+ licenses: Optional[List[str]] = None,
+ resource_provider: Optional[List["_models.ConnectorDefinitionsResourceProvider"]] = None,
+ customs: Optional[List["_models.CustomPermissionDetails"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword tenant: Gets or sets the required tenant permissions for the connector.
+ :paramtype tenant: list[str]
+ :keyword licenses: Gets or sets the required licenses for the user to create connections.
+ :paramtype licenses: list[str]
+ :keyword resource_provider: Gets or sets the resource provider permissions required for the
+ user to create connections.
+ :paramtype resource_provider:
+ list[~azure.mgmt.securityinsight.models.ConnectorDefinitionsResourceProvider]
+ :keyword customs: Gets or sets the customs permissions required for the user to create
+ connections.
+ :paramtype customs: list[~azure.mgmt.securityinsight.models.CustomPermissionDetails]
"""
super().__init__(**kwargs)
- self.is_active = is_active
- self.auth = auth
- self.request = request
- self.paging = paging
- self.response = response
+ self.tenant = tenant
+ self.licenses = licenses
+ self.resource_provider = resource_provider
+ self.customs = customs
-class CodelessConnectorPollingPagingProperties(_serialization.Model):
- """Describe the properties needed to make a pagination call.
+class ConnectorDefinitionsResourceProvider(_serialization.Model):
+ """The resource provider details include the required permissions for the user to create
+ connections.
+ The user should have the required permissions(Read\\Write, ..) in the specified scope
+ ProviderPermissionsScope against the specified resource provider.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar paging_type: Describes the type. could be 'None', 'PageToken', 'PageCount', 'TimeStamp'.
+ :ivar provider: Gets or sets the provider name. Required.
+ :vartype provider: str
+ :ivar permissions_display_text: Gets or sets the permissions description text. Required.
+ :vartype permissions_display_text: str
+ :ivar provider_display_name: Gets or sets the permissions provider display name. Required.
+ :vartype provider_display_name: str
+ :ivar scope: The scope on which the user should have permissions, in order to be able to create
+ connections. Required. Known values are: "Subscription", "ResourceGroup", and "Workspace".
+ :vartype scope: str or ~azure.mgmt.securityinsight.models.ProviderPermissionsScope
+ :ivar required_permissions: Required permissions for the connector resource provider that
+ define in ResourceProviders.
+ For more information about the permissions see :code:`here`. # pylint: disable=line-too-long
Required.
- :vartype paging_type: str
- :ivar next_page_para_name: Defines the name of a next page attribute.
- :vartype next_page_para_name: str
- :ivar next_page_token_json_path: Defines the path to a next page token JSON.
- :vartype next_page_token_json_path: str
- :ivar page_count_attribute_path: Defines the path to a page count attribute.
- :vartype page_count_attribute_path: str
- :ivar page_total_count_attribute_path: Defines the path to a page total count attribute.
- :vartype page_total_count_attribute_path: str
- :ivar page_time_stamp_attribute_path: Defines the path to a paging time stamp attribute.
- :vartype page_time_stamp_attribute_path: str
- :ivar search_the_latest_time_stamp_from_events_list: Determines whether to search for the
- latest time stamp in the events list.
- :vartype search_the_latest_time_stamp_from_events_list: str
- :ivar page_size_para_name: Defines the name of the page size parameter.
- :vartype page_size_para_name: str
- :ivar page_size: Defines the paging size.
- :vartype page_size: int
+ :vartype required_permissions:
+ ~azure.mgmt.securityinsight.models.ResourceProviderRequiredPermissions
"""
_validation = {
- "paging_type": {"required": True},
+ "provider": {"required": True},
+ "permissions_display_text": {"required": True},
+ "provider_display_name": {"required": True},
+ "scope": {"required": True},
+ "required_permissions": {"required": True},
}
_attribute_map = {
- "paging_type": {"key": "pagingType", "type": "str"},
- "next_page_para_name": {"key": "nextPageParaName", "type": "str"},
- "next_page_token_json_path": {"key": "nextPageTokenJsonPath", "type": "str"},
- "page_count_attribute_path": {"key": "pageCountAttributePath", "type": "str"},
- "page_total_count_attribute_path": {"key": "pageTotalCountAttributePath", "type": "str"},
- "page_time_stamp_attribute_path": {"key": "pageTimeStampAttributePath", "type": "str"},
- "search_the_latest_time_stamp_from_events_list": {
- "key": "searchTheLatestTimeStampFromEventsList",
- "type": "str",
- },
- "page_size_para_name": {"key": "pageSizeParaName", "type": "str"},
- "page_size": {"key": "pageSize", "type": "int"},
+ "provider": {"key": "provider", "type": "str"},
+ "permissions_display_text": {"key": "permissionsDisplayText", "type": "str"},
+ "provider_display_name": {"key": "providerDisplayName", "type": "str"},
+ "scope": {"key": "scope", "type": "str"},
+ "required_permissions": {"key": "requiredPermissions", "type": "ResourceProviderRequiredPermissions"},
}
def __init__(
self,
*,
- paging_type: str,
- next_page_para_name: Optional[str] = None,
- next_page_token_json_path: Optional[str] = None,
- page_count_attribute_path: Optional[str] = None,
- page_total_count_attribute_path: Optional[str] = None,
- page_time_stamp_attribute_path: Optional[str] = None,
- search_the_latest_time_stamp_from_events_list: Optional[str] = None,
- page_size_para_name: Optional[str] = None,
- page_size: Optional[int] = None,
- **kwargs
- ):
- """
- :keyword paging_type: Describes the type. could be 'None', 'PageToken', 'PageCount',
- 'TimeStamp'. Required.
- :paramtype paging_type: str
- :keyword next_page_para_name: Defines the name of a next page attribute.
- :paramtype next_page_para_name: str
- :keyword next_page_token_json_path: Defines the path to a next page token JSON.
- :paramtype next_page_token_json_path: str
- :keyword page_count_attribute_path: Defines the path to a page count attribute.
- :paramtype page_count_attribute_path: str
- :keyword page_total_count_attribute_path: Defines the path to a page total count attribute.
- :paramtype page_total_count_attribute_path: str
- :keyword page_time_stamp_attribute_path: Defines the path to a paging time stamp attribute.
- :paramtype page_time_stamp_attribute_path: str
- :keyword search_the_latest_time_stamp_from_events_list: Determines whether to search for the
- latest time stamp in the events list.
- :paramtype search_the_latest_time_stamp_from_events_list: str
- :keyword page_size_para_name: Defines the name of the page size parameter.
- :paramtype page_size_para_name: str
- :keyword page_size: Defines the paging size.
- :paramtype page_size: int
+ provider: str,
+ permissions_display_text: str,
+ provider_display_name: str,
+ scope: Union[str, "_models.ProviderPermissionsScope"],
+ required_permissions: "_models.ResourceProviderRequiredPermissions",
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword provider: Gets or sets the provider name. Required.
+ :paramtype provider: str
+ :keyword permissions_display_text: Gets or sets the permissions description text. Required.
+ :paramtype permissions_display_text: str
+ :keyword provider_display_name: Gets or sets the permissions provider display name. Required.
+ :paramtype provider_display_name: str
+ :keyword scope: The scope on which the user should have permissions, in order to be able to
+ create connections. Required. Known values are: "Subscription", "ResourceGroup", and
+ "Workspace".
+ :paramtype scope: str or ~azure.mgmt.securityinsight.models.ProviderPermissionsScope
+ :keyword required_permissions: Required permissions for the connector resource provider that
+ define in ResourceProviders.
+ For more information about the permissions see :code:`here`. # pylint: disable=line-too-long
+ Required.
+ :paramtype required_permissions:
+ ~azure.mgmt.securityinsight.models.ResourceProviderRequiredPermissions
"""
super().__init__(**kwargs)
- self.paging_type = paging_type
- self.next_page_para_name = next_page_para_name
- self.next_page_token_json_path = next_page_token_json_path
- self.page_count_attribute_path = page_count_attribute_path
- self.page_total_count_attribute_path = page_total_count_attribute_path
- self.page_time_stamp_attribute_path = page_time_stamp_attribute_path
- self.search_the_latest_time_stamp_from_events_list = search_the_latest_time_stamp_from_events_list
- self.page_size_para_name = page_size_para_name
- self.page_size = page_size
+ self.provider = provider
+ self.permissions_display_text = permissions_display_text
+ self.provider_display_name = provider_display_name
+ self.scope = scope
+ self.required_permissions = required_permissions
-class CodelessConnectorPollingRequestProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Describe the request properties needed to successfully pull from the server.
+class CustomizableConnectionsConfig(_serialization.Model):
+ """The UiConfig for 'Customizable' connector definition kind.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar api_endpoint: Describe the endpoint we should pull the data from. Required.
- :vartype api_endpoint: str
- :ivar rate_limit_qps: Defines the rate limit QPS.
- :vartype rate_limit_qps: int
- :ivar query_window_in_min: The window interval we will use the pull the data. Required.
- :vartype query_window_in_min: int
- :ivar http_method: The http method type we will use in the poll request, GET or POST. Required.
- :vartype http_method: str
- :ivar query_time_format: The time format will be used the query events in a specific window.
+ :ivar template_spec_name: Gets or sets the template name. The template includes ARM templates
+ that can be created by the connector, usually it will be the dataConnectors ARM templates.
Required.
- :vartype query_time_format: str
- :ivar retry_count: Describe the amount of time we should try and poll the data in case of
- failure.
- :vartype retry_count: int
- :ivar timeout_in_seconds: The number of seconds we will consider as a request timeout.
- :vartype timeout_in_seconds: int
- :ivar headers: Describe the headers sent in the poll request.
- :vartype headers: JSON
- :ivar query_parameters: Describe the query parameters sent in the poll request.
- :vartype query_parameters: JSON
- :ivar query_parameters_template: For advanced scenarios for example user name/password embedded
- in nested JSON payload.
- :vartype query_parameters_template: str
- :ivar start_time_attribute_name: This will be used the query events from a start of the time
- window.
- :vartype start_time_attribute_name: str
- :ivar end_time_attribute_name: This will be used the query events from the end of the time
- window.
- :vartype end_time_attribute_name: str
+ :vartype template_spec_name: str
+ :ivar template_spec_version: Gets or sets the template version. Required.
+ :vartype template_spec_version: str
"""
_validation = {
- "api_endpoint": {"required": True},
- "query_window_in_min": {"required": True},
- "http_method": {"required": True},
- "query_time_format": {"required": True},
+ "template_spec_name": {"required": True},
+ "template_spec_version": {"required": True},
}
_attribute_map = {
- "api_endpoint": {"key": "apiEndpoint", "type": "str"},
- "rate_limit_qps": {"key": "rateLimitQps", "type": "int"},
- "query_window_in_min": {"key": "queryWindowInMin", "type": "int"},
- "http_method": {"key": "httpMethod", "type": "str"},
- "query_time_format": {"key": "queryTimeFormat", "type": "str"},
- "retry_count": {"key": "retryCount", "type": "int"},
- "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"},
- "headers": {"key": "headers", "type": "object"},
- "query_parameters": {"key": "queryParameters", "type": "object"},
- "query_parameters_template": {"key": "queryParametersTemplate", "type": "str"},
- "start_time_attribute_name": {"key": "startTimeAttributeName", "type": "str"},
- "end_time_attribute_name": {"key": "endTimeAttributeName", "type": "str"},
+ "template_spec_name": {"key": "templateSpecName", "type": "str"},
+ "template_spec_version": {"key": "templateSpecVersion", "type": "str"},
}
- def __init__(
- self,
- *,
- api_endpoint: str,
- query_window_in_min: int,
- http_method: str,
- query_time_format: str,
- rate_limit_qps: Optional[int] = None,
- retry_count: Optional[int] = None,
- timeout_in_seconds: Optional[int] = None,
- headers: Optional[JSON] = None,
- query_parameters: Optional[JSON] = None,
- query_parameters_template: Optional[str] = None,
- start_time_attribute_name: Optional[str] = None,
- end_time_attribute_name: Optional[str] = None,
- **kwargs
- ):
+ def __init__(self, *, template_spec_name: str, template_spec_version: str, **kwargs: Any) -> None:
"""
- :keyword api_endpoint: Describe the endpoint we should pull the data from. Required.
- :paramtype api_endpoint: str
- :keyword rate_limit_qps: Defines the rate limit QPS.
- :paramtype rate_limit_qps: int
- :keyword query_window_in_min: The window interval we will use the pull the data. Required.
- :paramtype query_window_in_min: int
- :keyword http_method: The http method type we will use in the poll request, GET or POST.
- Required.
- :paramtype http_method: str
- :keyword query_time_format: The time format will be used the query events in a specific window.
- Required.
- :paramtype query_time_format: str
- :keyword retry_count: Describe the amount of time we should try and poll the data in case of
- failure.
- :paramtype retry_count: int
- :keyword timeout_in_seconds: The number of seconds we will consider as a request timeout.
- :paramtype timeout_in_seconds: int
- :keyword headers: Describe the headers sent in the poll request.
- :paramtype headers: JSON
- :keyword query_parameters: Describe the query parameters sent in the poll request.
- :paramtype query_parameters: JSON
- :keyword query_parameters_template: For advanced scenarios for example user name/password
- embedded in nested JSON payload.
- :paramtype query_parameters_template: str
- :keyword start_time_attribute_name: This will be used the query events from a start of the time
- window.
- :paramtype start_time_attribute_name: str
- :keyword end_time_attribute_name: This will be used the query events from the end of the time
- window.
- :paramtype end_time_attribute_name: str
+ :keyword template_spec_name: Gets or sets the template name. The template includes ARM
+ templates that can be created by the connector, usually it will be the dataConnectors ARM
+ templates. Required.
+ :paramtype template_spec_name: str
+ :keyword template_spec_version: Gets or sets the template version. Required.
+ :paramtype template_spec_version: str
"""
super().__init__(**kwargs)
- self.api_endpoint = api_endpoint
- self.rate_limit_qps = rate_limit_qps
- self.query_window_in_min = query_window_in_min
- self.http_method = http_method
- self.query_time_format = query_time_format
- self.retry_count = retry_count
- self.timeout_in_seconds = timeout_in_seconds
- self.headers = headers
- self.query_parameters = query_parameters
- self.query_parameters_template = query_parameters_template
- self.start_time_attribute_name = start_time_attribute_name
- self.end_time_attribute_name = end_time_attribute_name
+ self.template_spec_name = template_spec_name
+ self.template_spec_version = template_spec_version
-class CodelessConnectorPollingResponseProperties(_serialization.Model):
- """Describes the response from the external server.
+class DataConnectorDefinition(ResourceWithEtag):
+ """An Azure resource, which encapsulate the entire info requires to display a data connector page
+ in Azure portal,
+ and the info required to define data connections.
- All required parameters must be populated in order to send to Azure.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ CustomizableConnectorDefinition
- :ivar events_json_paths: Describes the path we should extract the data in the response.
- Required.
- :vartype events_json_paths: list[str]
- :ivar success_status_json_path: Describes the path we should extract the status code in the
- response.
- :vartype success_status_json_path: str
- :ivar success_status_value: Describes the path we should extract the status value in the
- response.
- :vartype success_status_value: str
- :ivar is_gzip_compressed: Describes if the data in the response is Gzip.
- :vartype is_gzip_compressed: bool
+ 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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The data connector kind. Required. "Customizable"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorDefinitionKind
"""
_validation = {
- "events_json_paths": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
}
_attribute_map = {
- "events_json_paths": {"key": "eventsJsonPaths", "type": "[str]"},
- "success_status_json_path": {"key": "successStatusJsonPath", "type": "str"},
- "success_status_value": {"key": "successStatusValue", "type": "str"},
- "is_gzip_compressed": {"key": "isGzipCompressed", "type": "bool"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ }
+
+ _subtype_map = {"kind": {"Customizable": "CustomizableConnectorDefinition"}}
+
+ def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.kind: Optional[str] = None
+
+
+class CustomizableConnectorDefinition(DataConnectorDefinition):
+ """Connector definition for kind 'Customizable'.
+
+ 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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The data connector kind. Required. "Customizable"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorDefinitionKind
+ :ivar created_time_utc: Gets or sets the connector definition created date in UTC format.
+ :vartype created_time_utc: ~datetime.datetime
+ :ivar last_modified_utc: Gets or sets the connector definition last modified date in UTC
+ format.
+ :vartype last_modified_utc: ~datetime.datetime
+ :ivar connector_ui_config: The UiConfig for 'Customizable' connector definition kind.
+ :vartype connector_ui_config: ~azure.mgmt.securityinsight.models.CustomizableConnectorUiConfig
+ :ivar connections_config: The UiConfig for 'Customizable' connector definition kind.
+ :vartype connections_config: ~azure.mgmt.securityinsight.models.CustomizableConnectionsConfig
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
+ "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
+ "connector_ui_config": {"key": "properties.connectorUiConfig", "type": "CustomizableConnectorUiConfig"},
+ "connections_config": {"key": "properties.connectionsConfig", "type": "CustomizableConnectionsConfig"},
}
def __init__(
self,
*,
- events_json_paths: List[str],
- success_status_json_path: Optional[str] = None,
- success_status_value: Optional[str] = None,
- is_gzip_compressed: Optional[bool] = None,
- **kwargs
- ):
+ etag: Optional[str] = None,
+ created_time_utc: Optional[datetime.datetime] = None,
+ last_modified_utc: Optional[datetime.datetime] = None,
+ connector_ui_config: Optional["_models.CustomizableConnectorUiConfig"] = None,
+ connections_config: Optional["_models.CustomizableConnectionsConfig"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword events_json_paths: Describes the path we should extract the data in the response.
- Required.
- :paramtype events_json_paths: list[str]
- :keyword success_status_json_path: Describes the path we should extract the status code in the
- response.
- :paramtype success_status_json_path: str
- :keyword success_status_value: Describes the path we should extract the status value in the
- response.
- :paramtype success_status_value: str
- :keyword is_gzip_compressed: Describes if the data in the response is Gzip.
- :paramtype is_gzip_compressed: bool
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword created_time_utc: Gets or sets the connector definition created date in UTC format.
+ :paramtype created_time_utc: ~datetime.datetime
+ :keyword last_modified_utc: Gets or sets the connector definition last modified date in UTC
+ format.
+ :paramtype last_modified_utc: ~datetime.datetime
+ :keyword connector_ui_config: The UiConfig for 'Customizable' connector definition kind.
+ :paramtype connector_ui_config:
+ ~azure.mgmt.securityinsight.models.CustomizableConnectorUiConfig
+ :keyword connections_config: The UiConfig for 'Customizable' connector definition kind.
+ :paramtype connections_config: ~azure.mgmt.securityinsight.models.CustomizableConnectionsConfig
"""
- super().__init__(**kwargs)
- self.events_json_paths = events_json_paths
- self.success_status_json_path = success_status_json_path
- self.success_status_value = success_status_value
- self.is_gzip_compressed = is_gzip_compressed
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = "Customizable"
+ self.created_time_utc = created_time_utc
+ self.last_modified_utc = last_modified_utc
+ self.connector_ui_config = connector_ui_config
+ self.connections_config = connections_config
-class CodelessUiConnectorConfigProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Config to describe the instructions blade.
+class CustomizableConnectorUiConfig(_serialization.Model):
+ """The UiConfig for 'Customizable' connector definition kind.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar title: Connector blade title. Required.
+ :ivar id: Gets or sets custom connector id. optional field.
+ :vartype id: str
+ :ivar title: Gets or sets the connector blade title. Required.
:vartype title: str
- :ivar publisher: Connector publisher name. Required.
+ :ivar publisher: Gets or sets the connector publisher name. Required.
:vartype publisher: str
- :ivar description_markdown: Connector description. Required.
+ :ivar description_markdown: Gets or sets the connector description in markdown format.
+ Required.
:vartype description_markdown: str
- :ivar custom_image: An optional custom image to be used when displaying the connector within
- Azure Sentinel's connector's gallery.
- :vartype custom_image: str
- :ivar graph_queries_table_name: Name of the table the connector will insert the data to.
+ :ivar graph_queries: Gets or sets the graph queries to show the current data volume over time.
Required.
- :vartype graph_queries_table_name: str
- :ivar graph_queries: The graph query to show the current data status. Required.
- :vartype graph_queries:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem]
- :ivar sample_queries: The sample queries for the connector. Required.
- :vartype sample_queries:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem]
- :ivar data_types: Data types to check for last data received. Required.
- :vartype data_types:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesDataTypesItem]
- :ivar connectivity_criteria: Define the way the connector check connectivity. Required.
- :vartype connectivity_criteria:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem]
- :ivar availability: Connector Availability Status. Required.
- :vartype availability: ~azure.mgmt.securityinsight.models.Availability
- :ivar permissions: Permissions required for the connector. Required.
- :vartype permissions: ~azure.mgmt.securityinsight.models.Permissions
- :ivar instruction_steps: Instruction steps to enable the connector. Required.
- :vartype instruction_steps:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem]
+ :vartype graph_queries: list[~azure.mgmt.securityinsight.models.GraphQuery]
+ :ivar data_types: Gets or sets the data types to check for last data received. Required.
+ :vartype data_types: list[~azure.mgmt.securityinsight.models.ConnectorDataType]
+ :ivar connectivity_criteria: Gets or sets the way the connector checks whether the connector is
+ connected. Required.
+ :vartype connectivity_criteria: list[~azure.mgmt.securityinsight.models.ConnectivityCriterion]
+ :ivar availability: The exposure status of the connector to the customers.
+ :vartype availability: ~azure.mgmt.securityinsight.models.ConnectorDefinitionsAvailability
+ :ivar permissions: The required Permissions for the connector. Required.
+ :vartype permissions: ~azure.mgmt.securityinsight.models.ConnectorDefinitionsPermissions
+ :ivar instruction_steps: Gets or sets the instruction steps to enable the connector. Required.
+ :vartype instruction_steps: list[~azure.mgmt.securityinsight.models.InstructionStep]
+ :ivar logo: Gets or sets the connector logo to be used when displaying the connector within
+ Azure Sentinel's connector's gallery.
+ The logo value should be in SVG format.
+ :vartype logo: str
+ :ivar is_connectivity_criterias_match_some: Gets or sets a value indicating whether to use
+ 'OR'(SOME) or 'AND' between ConnectivityCriteria items.
+ :vartype is_connectivity_criterias_match_some: bool
"""
_validation = {
"title": {"required": True},
"publisher": {"required": True},
"description_markdown": {"required": True},
- "graph_queries_table_name": {"required": True},
"graph_queries": {"required": True},
- "sample_queries": {"required": True},
"data_types": {"required": True},
"connectivity_criteria": {"required": True},
- "availability": {"required": True},
"permissions": {"required": True},
"instruction_steps": {"required": True},
}
_attribute_map = {
+ "id": {"key": "id", "type": "str"},
"title": {"key": "title", "type": "str"},
"publisher": {"key": "publisher", "type": "str"},
"description_markdown": {"key": "descriptionMarkdown", "type": "str"},
- "custom_image": {"key": "customImage", "type": "str"},
- "graph_queries_table_name": {"key": "graphQueriesTableName", "type": "str"},
- "graph_queries": {"key": "graphQueries", "type": "[CodelessUiConnectorConfigPropertiesGraphQueriesItem]"},
- "sample_queries": {"key": "sampleQueries", "type": "[CodelessUiConnectorConfigPropertiesSampleQueriesItem]"},
- "data_types": {"key": "dataTypes", "type": "[CodelessUiConnectorConfigPropertiesDataTypesItem]"},
- "connectivity_criteria": {
- "key": "connectivityCriteria",
- "type": "[CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem]",
- },
- "availability": {"key": "availability", "type": "Availability"},
- "permissions": {"key": "permissions", "type": "Permissions"},
- "instruction_steps": {
- "key": "instructionSteps",
- "type": "[CodelessUiConnectorConfigPropertiesInstructionStepsItem]",
- },
+ "graph_queries": {"key": "graphQueries", "type": "[GraphQuery]"},
+ "data_types": {"key": "dataTypes", "type": "[ConnectorDataType]"},
+ "connectivity_criteria": {"key": "connectivityCriteria", "type": "[ConnectivityCriterion]"},
+ "availability": {"key": "availability", "type": "ConnectorDefinitionsAvailability"},
+ "permissions": {"key": "permissions", "type": "ConnectorDefinitionsPermissions"},
+ "instruction_steps": {"key": "instructionSteps", "type": "[InstructionStep]"},
+ "logo": {"key": "logo", "type": "str"},
+ "is_connectivity_criterias_match_some": {"key": "isConnectivityCriteriasMatchSome", "type": "bool"},
}
def __init__(
@@ -5538,394 +3733,339 @@ def __init__(
title: str,
publisher: str,
description_markdown: str,
- graph_queries_table_name: str,
- graph_queries: List["_models.CodelessUiConnectorConfigPropertiesGraphQueriesItem"],
- sample_queries: List["_models.CodelessUiConnectorConfigPropertiesSampleQueriesItem"],
- data_types: List["_models.CodelessUiConnectorConfigPropertiesDataTypesItem"],
- connectivity_criteria: List["_models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem"],
- availability: "_models.Availability",
- permissions: "_models.Permissions",
- instruction_steps: List["_models.CodelessUiConnectorConfigPropertiesInstructionStepsItem"],
- custom_image: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword title: Connector blade title. Required.
+ graph_queries: List["_models.GraphQuery"],
+ data_types: List["_models.ConnectorDataType"],
+ connectivity_criteria: List["_models.ConnectivityCriterion"],
+ permissions: "_models.ConnectorDefinitionsPermissions",
+ instruction_steps: List["_models.InstructionStep"],
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ availability: Optional["_models.ConnectorDefinitionsAvailability"] = None,
+ logo: Optional[str] = None,
+ is_connectivity_criterias_match_some: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword id: Gets or sets custom connector id. optional field.
+ :paramtype id: str
+ :keyword title: Gets or sets the connector blade title. Required.
:paramtype title: str
- :keyword publisher: Connector publisher name. Required.
+ :keyword publisher: Gets or sets the connector publisher name. Required.
:paramtype publisher: str
- :keyword description_markdown: Connector description. Required.
- :paramtype description_markdown: str
- :keyword custom_image: An optional custom image to be used when displaying the connector within
- Azure Sentinel's connector's gallery.
- :paramtype custom_image: str
- :keyword graph_queries_table_name: Name of the table the connector will insert the data to.
+ :keyword description_markdown: Gets or sets the connector description in markdown format.
Required.
- :paramtype graph_queries_table_name: str
- :keyword graph_queries: The graph query to show the current data status. Required.
- :paramtype graph_queries:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem]
- :keyword sample_queries: The sample queries for the connector. Required.
- :paramtype sample_queries:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem]
- :keyword data_types: Data types to check for last data received. Required.
- :paramtype data_types:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesDataTypesItem]
- :keyword connectivity_criteria: Define the way the connector check connectivity. Required.
+ :paramtype description_markdown: str
+ :keyword graph_queries: Gets or sets the graph queries to show the current data volume over
+ time. Required.
+ :paramtype graph_queries: list[~azure.mgmt.securityinsight.models.GraphQuery]
+ :keyword data_types: Gets or sets the data types to check for last data received. Required.
+ :paramtype data_types: list[~azure.mgmt.securityinsight.models.ConnectorDataType]
+ :keyword connectivity_criteria: Gets or sets the way the connector checks whether the connector
+ is connected. Required.
:paramtype connectivity_criteria:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem]
- :keyword availability: Connector Availability Status. Required.
- :paramtype availability: ~azure.mgmt.securityinsight.models.Availability
- :keyword permissions: Permissions required for the connector. Required.
- :paramtype permissions: ~azure.mgmt.securityinsight.models.Permissions
- :keyword instruction_steps: Instruction steps to enable the connector. Required.
- :paramtype instruction_steps:
- list[~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem]
+ list[~azure.mgmt.securityinsight.models.ConnectivityCriterion]
+ :keyword availability: The exposure status of the connector to the customers.
+ :paramtype availability: ~azure.mgmt.securityinsight.models.ConnectorDefinitionsAvailability
+ :keyword permissions: The required Permissions for the connector. Required.
+ :paramtype permissions: ~azure.mgmt.securityinsight.models.ConnectorDefinitionsPermissions
+ :keyword instruction_steps: Gets or sets the instruction steps to enable the connector.
+ Required.
+ :paramtype instruction_steps: list[~azure.mgmt.securityinsight.models.InstructionStep]
+ :keyword logo: Gets or sets the connector logo to be used when displaying the connector within
+ Azure Sentinel's connector's gallery.
+ The logo value should be in SVG format.
+ :paramtype logo: str
+ :keyword is_connectivity_criterias_match_some: Gets or sets a value indicating whether to use
+ 'OR'(SOME) or 'AND' between ConnectivityCriteria items.
+ :paramtype is_connectivity_criterias_match_some: bool
"""
super().__init__(**kwargs)
+ self.id = id
self.title = title
self.publisher = publisher
self.description_markdown = description_markdown
- self.custom_image = custom_image
- self.graph_queries_table_name = graph_queries_table_name
self.graph_queries = graph_queries
- self.sample_queries = sample_queries
self.data_types = data_types
self.connectivity_criteria = connectivity_criteria
self.availability = availability
self.permissions = permissions
self.instruction_steps = instruction_steps
+ self.logo = logo
+ self.is_connectivity_criterias_match_some = is_connectivity_criterias_match_some
-class ConnectivityCriteria(_serialization.Model):
- """Setting for the connector check connectivity.
+class CustomPermissionDetails(_serialization.Model):
+ """The Custom permissions required for the connector.
- :ivar type: type of connectivity. "IsConnectedQuery"
- :vartype type: str or ~azure.mgmt.securityinsight.models.ConnectivityType
- :ivar value: Queries for checking connectivity.
- :vartype value: list[str]
+ All required parameters must be populated in order to send to server.
+
+ :ivar name: Gets or sets the custom permissions name. Required.
+ :vartype name: str
+ :ivar description: Gets or sets the custom permissions description. Required.
+ :vartype description: str
"""
+ _validation = {
+ "name": {"required": True},
+ "description": {"required": True},
+ }
+
_attribute_map = {
- "type": {"key": "type", "type": "str"},
- "value": {"key": "value", "type": "[str]"},
+ "name": {"key": "name", "type": "str"},
+ "description": {"key": "description", "type": "str"},
}
- def __init__(
- self,
- *,
- type: Optional[Union[str, "_models.ConnectivityType"]] = None,
- value: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword type: type of connectivity. "IsConnectedQuery"
- :paramtype type: str or ~azure.mgmt.securityinsight.models.ConnectivityType
- :keyword value: Queries for checking connectivity.
- :paramtype value: list[str]
+ def __init__(self, *, name: str, description: str, **kwargs: Any) -> None:
+ """
+ :keyword name: Gets or sets the custom permissions name. Required.
+ :paramtype name: str
+ :keyword description: Gets or sets the custom permissions description. Required.
+ :paramtype description: str
"""
super().__init__(**kwargs)
- self.type = type
- self.value = value
+ self.name = name
+ self.description = description
-class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem(ConnectivityCriteria):
- """CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.
+class DataConnectorDefinitionArmCollectionWrapper(_serialization.Model): # pylint: disable=name-too-long
+ """Encapsulate the data connector definition object.
- :ivar type: type of connectivity. "IsConnectedQuery"
- :vartype type: str or ~azure.mgmt.securityinsight.models.ConnectivityType
- :ivar value: Queries for checking connectivity.
- :vartype value: list[str]
+ :ivar value:
+ :vartype value: list[~azure.mgmt.securityinsight.models.DataConnectorDefinition]
+ :ivar next_link:
+ :vartype next_link: str
"""
_attribute_map = {
- "type": {"key": "type", "type": "str"},
- "value": {"key": "value", "type": "[str]"},
+ "value": {"key": "value", "type": "[DataConnectorDefinition]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
- type: Optional[Union[str, "_models.ConnectivityType"]] = None,
- value: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword type: type of connectivity. "IsConnectedQuery"
- :paramtype type: str or ~azure.mgmt.securityinsight.models.ConnectivityType
- :keyword value: Queries for checking connectivity.
- :paramtype value: list[str]
+ value: Optional[List["_models.DataConnectorDefinition"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- super().__init__(type=type, value=value, **kwargs)
+ :keyword value:
+ :paramtype value: list[~azure.mgmt.securityinsight.models.DataConnectorDefinition]
+ :keyword next_link:
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
-class LastDataReceivedDataType(_serialization.Model):
- """Data type for last data received.
+class DataConnectorList(_serialization.Model):
+ """List all the data connectors.
- :ivar name: Name of the data type to show in the graph. can be use with
- {{graphQueriesTableName}} placeholder.
- :vartype name: str
- :ivar last_data_received_query: Query for indicate last data received.
- :vartype last_data_received_query: str
- """
-
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "last_data_received_query": {"key": "lastDataReceivedQuery", "type": "str"},
- }
-
- def __init__(self, *, name: Optional[str] = None, last_data_received_query: Optional[str] = None, **kwargs):
- """
- :keyword name: Name of the data type to show in the graph. can be use with
- {{graphQueriesTableName}} placeholder.
- :paramtype name: str
- :keyword last_data_received_query: Query for indicate last data received.
- :paramtype last_data_received_query: str
- """
- super().__init__(**kwargs)
- self.name = name
- self.last_data_received_query = last_data_received_query
+ 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 server.
-class CodelessUiConnectorConfigPropertiesDataTypesItem(LastDataReceivedDataType):
- """CodelessUiConnectorConfigPropertiesDataTypesItem.
-
- :ivar name: Name of the data type to show in the graph. can be use with
- {{graphQueriesTableName}} placeholder.
- :vartype name: str
- :ivar last_data_received_query: Query for indicate last data received.
- :vartype last_data_received_query: str
+ :ivar next_link: URL to fetch the next set of data connectors.
+ :vartype next_link: str
+ :ivar value: Array of data connectors. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.DataConnector]
"""
+ _validation = {
+ "next_link": {"readonly": True},
+ "value": {"required": True},
+ }
+
_attribute_map = {
- "name": {"key": "name", "type": "str"},
- "last_data_received_query": {"key": "lastDataReceivedQuery", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[DataConnector]"},
}
- def __init__(self, *, name: Optional[str] = None, last_data_received_query: Optional[str] = None, **kwargs):
+ def __init__(self, *, value: List["_models.DataConnector"], **kwargs: Any) -> None:
"""
- :keyword name: Name of the data type to show in the graph. can be use with
- {{graphQueriesTableName}} placeholder.
- :paramtype name: str
- :keyword last_data_received_query: Query for indicate last data received.
- :paramtype last_data_received_query: str
+ :keyword value: Array of data connectors. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.DataConnector]
"""
- super().__init__(name=name, last_data_received_query=last_data_received_query, **kwargs)
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class GraphQueries(_serialization.Model):
- """The graph query to show the current data status.
+class DataConnectorTenantId(_serialization.Model):
+ """Properties data connector on tenant level.
- :ivar metric_name: the metric that the query is checking.
- :vartype metric_name: str
- :ivar legend: The legend for the graph.
- :vartype legend: str
- :ivar base_query: The base query for the graph.
- :vartype base_query: str
+ :ivar tenant_id: The tenant id to connect to, and get the data from.
+ :vartype tenant_id: str
"""
_attribute_map = {
- "metric_name": {"key": "metricName", "type": "str"},
- "legend": {"key": "legend", "type": "str"},
- "base_query": {"key": "baseQuery", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
}
- def __init__(
- self,
- *,
- metric_name: Optional[str] = None,
- legend: Optional[str] = None,
- base_query: Optional[str] = None,
- **kwargs
- ):
+ def __init__(self, *, tenant_id: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword metric_name: the metric that the query is checking.
- :paramtype metric_name: str
- :keyword legend: The legend for the graph.
- :paramtype legend: str
- :keyword base_query: The base query for the graph.
- :paramtype base_query: str
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
"""
super().__init__(**kwargs)
- self.metric_name = metric_name
- self.legend = legend
- self.base_query = base_query
+ self.tenant_id = tenant_id
-class CodelessUiConnectorConfigPropertiesGraphQueriesItem(GraphQueries):
- """CodelessUiConnectorConfigPropertiesGraphQueriesItem.
+class DCRConfiguration(_serialization.Model):
+ """The configuration of the destination of the data.
- :ivar metric_name: the metric that the query is checking.
- :vartype metric_name: str
- :ivar legend: The legend for the graph.
- :vartype legend: str
- :ivar base_query: The base query for the graph.
- :vartype base_query: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar data_collection_endpoint: Represents the data collection ingestion endpoint in log
+ analytics. Required.
+ :vartype data_collection_endpoint: str
+ :ivar data_collection_rule_immutable_id: The data collection rule immutable id, the rule
+ defines the transformation and data destination. Required.
+ :vartype data_collection_rule_immutable_id: str
+ :ivar stream_name: The stream we are sending the data to. Required.
+ :vartype stream_name: str
"""
+ _validation = {
+ "data_collection_endpoint": {"required": True},
+ "data_collection_rule_immutable_id": {"required": True},
+ "stream_name": {"required": True},
+ }
+
_attribute_map = {
- "metric_name": {"key": "metricName", "type": "str"},
- "legend": {"key": "legend", "type": "str"},
- "base_query": {"key": "baseQuery", "type": "str"},
+ "data_collection_endpoint": {"key": "dataCollectionEndpoint", "type": "str"},
+ "data_collection_rule_immutable_id": {"key": "dataCollectionRuleImmutableId", "type": "str"},
+ "stream_name": {"key": "streamName", "type": "str"},
}
def __init__(
- self,
- *,
- metric_name: Optional[str] = None,
- legend: Optional[str] = None,
- base_query: Optional[str] = None,
- **kwargs
- ):
+ self, *, data_collection_endpoint: str, data_collection_rule_immutable_id: str, stream_name: str, **kwargs: Any
+ ) -> None:
"""
- :keyword metric_name: the metric that the query is checking.
- :paramtype metric_name: str
- :keyword legend: The legend for the graph.
- :paramtype legend: str
- :keyword base_query: The base query for the graph.
- :paramtype base_query: str
+ :keyword data_collection_endpoint: Represents the data collection ingestion endpoint in log
+ analytics. Required.
+ :paramtype data_collection_endpoint: str
+ :keyword data_collection_rule_immutable_id: The data collection rule immutable id, the rule
+ defines the transformation and data destination. Required.
+ :paramtype data_collection_rule_immutable_id: str
+ :keyword stream_name: The stream we are sending the data to. Required.
+ :paramtype stream_name: str
"""
- super().__init__(metric_name=metric_name, legend=legend, base_query=base_query, **kwargs)
+ super().__init__(**kwargs)
+ self.data_collection_endpoint = data_collection_endpoint
+ self.data_collection_rule_immutable_id = data_collection_rule_immutable_id
+ self.stream_name = stream_name
-class InstructionSteps(_serialization.Model):
- """Instruction steps to enable the connector.
+class Deployment(_serialization.Model):
+ """Description about a deployment.
- :ivar title: Instruction step title.
- :vartype title: str
- :ivar description: Instruction step description.
- :vartype description: str
- :ivar instructions: Instruction step details.
- :vartype instructions:
- list[~azure.mgmt.securityinsight.models.InstructionStepsInstructionsItem]
+ :ivar deployment_id: Deployment identifier.
+ :vartype deployment_id: str
+ :ivar deployment_state: Current status of the deployment. Known values are: "In_Progress",
+ "Completed", "Queued", and "Canceling".
+ :vartype deployment_state: str or ~azure.mgmt.securityinsight.models.DeploymentState
+ :ivar deployment_result: The outcome of the deployment. Known values are: "Success",
+ "Canceled", and "Failed".
+ :vartype deployment_result: str or ~azure.mgmt.securityinsight.models.DeploymentResult
+ :ivar deployment_time: The time when the deployment finished.
+ :vartype deployment_time: ~datetime.datetime
+ :ivar deployment_logs_url: Url to access repository action logs.
+ :vartype deployment_logs_url: str
"""
_attribute_map = {
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "instructions": {"key": "instructions", "type": "[InstructionStepsInstructionsItem]"},
+ "deployment_id": {"key": "deploymentId", "type": "str"},
+ "deployment_state": {"key": "deploymentState", "type": "str"},
+ "deployment_result": {"key": "deploymentResult", "type": "str"},
+ "deployment_time": {"key": "deploymentTime", "type": "iso-8601"},
+ "deployment_logs_url": {"key": "deploymentLogsUrl", "type": "str"},
}
def __init__(
self,
*,
- title: Optional[str] = None,
- description: Optional[str] = None,
- instructions: Optional[List["_models.InstructionStepsInstructionsItem"]] = None,
- **kwargs
- ):
+ deployment_id: Optional[str] = None,
+ deployment_state: Optional[Union[str, "_models.DeploymentState"]] = None,
+ deployment_result: Optional[Union[str, "_models.DeploymentResult"]] = None,
+ deployment_time: Optional[datetime.datetime] = None,
+ deployment_logs_url: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword title: Instruction step title.
- :paramtype title: str
- :keyword description: Instruction step description.
- :paramtype description: str
- :keyword instructions: Instruction step details.
- :paramtype instructions:
- list[~azure.mgmt.securityinsight.models.InstructionStepsInstructionsItem]
+ :keyword deployment_id: Deployment identifier.
+ :paramtype deployment_id: str
+ :keyword deployment_state: Current status of the deployment. Known values are: "In_Progress",
+ "Completed", "Queued", and "Canceling".
+ :paramtype deployment_state: str or ~azure.mgmt.securityinsight.models.DeploymentState
+ :keyword deployment_result: The outcome of the deployment. Known values are: "Success",
+ "Canceled", and "Failed".
+ :paramtype deployment_result: str or ~azure.mgmt.securityinsight.models.DeploymentResult
+ :keyword deployment_time: The time when the deployment finished.
+ :paramtype deployment_time: ~datetime.datetime
+ :keyword deployment_logs_url: Url to access repository action logs.
+ :paramtype deployment_logs_url: str
"""
super().__init__(**kwargs)
- self.title = title
- self.description = description
- self.instructions = instructions
+ self.deployment_id = deployment_id
+ self.deployment_state = deployment_state
+ self.deployment_result = deployment_result
+ self.deployment_time = deployment_time
+ self.deployment_logs_url = deployment_logs_url
-class CodelessUiConnectorConfigPropertiesInstructionStepsItem(InstructionSteps):
- """CodelessUiConnectorConfigPropertiesInstructionStepsItem.
+class DeploymentInfo(_serialization.Model):
+ """Information regarding a deployment.
- :ivar title: Instruction step title.
- :vartype title: str
- :ivar description: Instruction step description.
- :vartype description: str
- :ivar instructions: Instruction step details.
- :vartype instructions:
- list[~azure.mgmt.securityinsight.models.InstructionStepsInstructionsItem]
+ :ivar deployment_fetch_status: Status while fetching the last deployment. Known values are:
+ "Success", "Unauthorized", and "NotFound".
+ :vartype deployment_fetch_status: str or
+ ~azure.mgmt.securityinsight.models.DeploymentFetchStatus
+ :ivar deployment: Deployment information.
+ :vartype deployment: ~azure.mgmt.securityinsight.models.Deployment
+ :ivar message: Additional details about the deployment that can be shown to the user.
+ :vartype message: str
"""
_attribute_map = {
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "instructions": {"key": "instructions", "type": "[InstructionStepsInstructionsItem]"},
+ "deployment_fetch_status": {"key": "deploymentFetchStatus", "type": "str"},
+ "deployment": {"key": "deployment", "type": "Deployment"},
+ "message": {"key": "message", "type": "str"},
}
def __init__(
self,
*,
- title: Optional[str] = None,
- description: Optional[str] = None,
- instructions: Optional[List["_models.InstructionStepsInstructionsItem"]] = None,
- **kwargs
- ):
- """
- :keyword title: Instruction step title.
- :paramtype title: str
- :keyword description: Instruction step description.
- :paramtype description: str
- :keyword instructions: Instruction step details.
- :paramtype instructions:
- list[~azure.mgmt.securityinsight.models.InstructionStepsInstructionsItem]
- """
- super().__init__(title=title, description=description, instructions=instructions, **kwargs)
-
-
-class SampleQueries(_serialization.Model):
- """The sample queries for the connector.
-
- :ivar description: The sample query description.
- :vartype description: str
- :ivar query: the sample query.
- :vartype query: str
- """
-
- _attribute_map = {
- "description": {"key": "description", "type": "str"},
- "query": {"key": "query", "type": "str"},
- }
-
- def __init__(self, *, description: Optional[str] = None, query: Optional[str] = None, **kwargs):
+ deployment_fetch_status: Optional[Union[str, "_models.DeploymentFetchStatus"]] = None,
+ deployment: Optional["_models.Deployment"] = None,
+ message: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword description: The sample query description.
- :paramtype description: str
- :keyword query: the sample query.
- :paramtype query: str
+ :keyword deployment_fetch_status: Status while fetching the last deployment. Known values are:
+ "Success", "Unauthorized", and "NotFound".
+ :paramtype deployment_fetch_status: str or
+ ~azure.mgmt.securityinsight.models.DeploymentFetchStatus
+ :keyword deployment: Deployment information.
+ :paramtype deployment: ~azure.mgmt.securityinsight.models.Deployment
+ :keyword message: Additional details about the deployment that can be shown to the user.
+ :paramtype message: str
"""
super().__init__(**kwargs)
- self.description = description
- self.query = query
-
-
-class CodelessUiConnectorConfigPropertiesSampleQueriesItem(SampleQueries):
- """CodelessUiConnectorConfigPropertiesSampleQueriesItem.
-
- :ivar description: The sample query description.
- :vartype description: str
- :ivar query: the sample query.
- :vartype query: str
- """
-
- _attribute_map = {
- "description": {"key": "description", "type": "str"},
- "query": {"key": "query", "type": "str"},
- }
-
- def __init__(self, *, description: Optional[str] = None, query: Optional[str] = None, **kwargs):
- """
- :keyword description: The sample query description.
- :paramtype description: str
- :keyword query: the sample query.
- :paramtype query: str
- """
- super().__init__(description=description, query=query, **kwargs)
+ self.deployment_fetch_status = deployment_fetch_status
+ self.deployment = deployment
+ self.message = message
-class CodelessUiDataConnector(DataConnector):
- """Represents Codeless UI data connector.
+class DnsEntity(Entity):
+ """Represents a dns entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -5935,19 +4075,25 @@ class CodelessUiDataConnector(DataConnector):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar connector_ui_config: Config to describe the instructions blade.
- :vartype connector_ui_config:
- ~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigProperties
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar dns_server_ip_entity_id: An ip entity id for the dns server resolving the request.
+ :vartype dns_server_ip_entity_id: str
+ :ivar domain_name: The name of the dns record associated with the alert.
+ :vartype domain_name: str
+ :ivar host_ip_address_entity_id: An ip entity id for the dns request client.
+ :vartype host_ip_address_entity_id: str
+ :ivar ip_address_entity_ids: Ip entity identifiers for the resolved ip address.
+ :vartype ip_address_entity_ids: list[str]
"""
_validation = {
@@ -5956,6 +4102,12 @@ class CodelessUiDataConnector(DataConnector):
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "dns_server_ip_entity_id": {"readonly": True},
+ "domain_name": {"readonly": True},
+ "host_ip_address_entity_id": {"readonly": True},
+ "ip_address_entity_ids": {"readonly": True},
}
_attribute_map = {
@@ -5963,505 +4115,311 @@ class CodelessUiDataConnector(DataConnector):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "connector_ui_config": {"key": "properties.connectorUiConfig", "type": "CodelessUiConnectorConfigProperties"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "dns_server_ip_entity_id": {"key": "properties.dnsServerIpEntityId", "type": "str"},
+ "domain_name": {"key": "properties.domainName", "type": "str"},
+ "host_ip_address_entity_id": {"key": "properties.hostIpAddressEntityId", "type": "str"},
+ "ip_address_entity_ids": {"key": "properties.ipAddressEntityIds", "type": "[str]"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- connector_ui_config: Optional["_models.CodelessUiConnectorConfigProperties"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword connector_ui_config: Config to describe the instructions blade.
- :paramtype connector_ui_config:
- ~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigProperties
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "GenericUI"
- self.connector_ui_config = connector_ui_config
-
-
-class ConnectedEntity(_serialization.Model):
- """Expansion result connected entities.
-
- :ivar target_entity_id: Entity Id of the connected entity.
- :vartype target_entity_id: str
- :ivar additional_data: key-value pairs for a connected entity mapping.
- :vartype additional_data: JSON
- """
-
- _attribute_map = {
- "target_entity_id": {"key": "targetEntityId", "type": "str"},
- "additional_data": {"key": "additionalData", "type": "object"},
- }
-
- def __init__(self, *, target_entity_id: Optional[str] = None, additional_data: Optional[JSON] = None, **kwargs):
- """
- :keyword target_entity_id: Entity Id of the connected entity.
- :paramtype target_entity_id: str
- :keyword additional_data: key-value pairs for a connected entity mapping.
- :paramtype additional_data: JSON
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.target_entity_id = target_entity_id
- self.additional_data = additional_data
+ self.kind: str = "DnsResolution"
+ self.additional_data = None
+ self.friendly_name = None
+ self.dns_server_ip_entity_id = None
+ self.domain_name = None
+ self.host_ip_address_entity_id = None
+ self.ip_address_entity_ids = None
-class ConnectorInstructionModelBase(_serialization.Model):
- """Instruction step details.
+class DnsEntityProperties(EntityCommonProperties):
+ """Dns entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar parameters: The parameters for the setting.
- :vartype parameters: JSON
- :ivar type: The kind of the setting. Required. Known values are: "CopyableLabel",
- "InstructionStepsGroup", and "InfoMessage".
- :vartype type: str or ~azure.mgmt.securityinsight.models.SettingType
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar dns_server_ip_entity_id: An ip entity id for the dns server resolving the request.
+ :vartype dns_server_ip_entity_id: str
+ :ivar domain_name: The name of the dns record associated with the alert.
+ :vartype domain_name: str
+ :ivar host_ip_address_entity_id: An ip entity id for the dns request client.
+ :vartype host_ip_address_entity_id: str
+ :ivar ip_address_entity_ids: Ip entity identifiers for the resolved ip address.
+ :vartype ip_address_entity_ids: list[str]
"""
_validation = {
- "type": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "dns_server_ip_entity_id": {"readonly": True},
+ "domain_name": {"readonly": True},
+ "host_ip_address_entity_id": {"readonly": True},
+ "ip_address_entity_ids": {"readonly": True},
}
_attribute_map = {
- "parameters": {"key": "parameters", "type": "object"},
- "type": {"key": "type", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "dns_server_ip_entity_id": {"key": "dnsServerIpEntityId", "type": "str"},
+ "domain_name": {"key": "domainName", "type": "str"},
+ "host_ip_address_entity_id": {"key": "hostIpAddressEntityId", "type": "str"},
+ "ip_address_entity_ids": {"key": "ipAddressEntityIds", "type": "[str]"},
}
- def __init__(self, *, type: Union[str, "_models.SettingType"], parameters: Optional[JSON] = None, **kwargs):
- """
- :keyword parameters: The parameters for the setting.
- :paramtype parameters: JSON
- :keyword type: The kind of the setting. Required. Known values are: "CopyableLabel",
- "InstructionStepsGroup", and "InfoMessage".
- :paramtype type: str or ~azure.mgmt.securityinsight.models.SettingType
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.parameters = parameters
- self.type = type
+ self.dns_server_ip_entity_id = None
+ self.domain_name = None
+ self.host_ip_address_entity_id = None
+ self.ip_address_entity_ids = None
-class Content(_serialization.Model):
- """Content section of the recommendation.
+class EntityManualTriggerRequestBody(_serialization.Model):
+ """Describes the request body for triggering a playbook on an entity.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar title: Title of the content. Required.
- :vartype title: str
- :ivar description: Description of the content. Required.
- :vartype description: str
+ :ivar incident_arm_id: The incident id to associate the entity with.
+ :vartype incident_arm_id: str
+ :ivar tenant_id: The tenant id of the playbook resource.
+ :vartype tenant_id: str
+ :ivar logic_apps_resource_id: The resource id of the playbook resource. Required.
+ :vartype logic_apps_resource_id: str
"""
_validation = {
- "title": {"required": True},
- "description": {"required": True},
+ "logic_apps_resource_id": {"required": True},
}
_attribute_map = {
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "incident_arm_id": {"key": "incidentArmId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "logic_apps_resource_id": {"key": "logicAppsResourceId", "type": "str"},
}
- def __init__(self, *, title: str, description: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ logic_apps_resource_id: str,
+ incident_arm_id: Optional[str] = None,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword title: Title of the content. Required.
- :paramtype title: str
- :keyword description: Description of the content. Required.
- :paramtype description: str
+ :keyword incident_arm_id: The incident id to associate the entity with.
+ :paramtype incident_arm_id: str
+ :keyword tenant_id: The tenant id of the playbook resource.
+ :paramtype tenant_id: str
+ :keyword logic_apps_resource_id: The resource id of the playbook resource. Required.
+ :paramtype logic_apps_resource_id: str
"""
super().__init__(**kwargs)
- self.title = title
- self.description = description
+ self.incident_arm_id = incident_arm_id
+ self.tenant_id = tenant_id
+ self.logic_apps_resource_id = logic_apps_resource_id
-class ContentPathMap(_serialization.Model):
- """The mapping of content type to a repo path.
+class EntityMapping(_serialization.Model):
+ """Single entity mapping for the alert rule.
- :ivar content_type: Content type. Known values are: "AnalyticRule" and "Workbook".
- :vartype content_type: str or ~azure.mgmt.securityinsight.models.ContentType
- :ivar path: The path to the content.
- :vartype path: str
+ :ivar entity_type: The V3 type of the mapped entity. Known values are: "Account", "Host", "IP",
+ "Malware", "File", "Process", "CloudApplication", "DNS", "AzureResource", "FileHash",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "Mailbox", "MailCluster",
+ "MailMessage", and "SubmissionMail".
+ :vartype entity_type: str or ~azure.mgmt.securityinsight.models.EntityMappingType
+ :ivar field_mappings: array of field mappings for the given entity mapping.
+ :vartype field_mappings: list[~azure.mgmt.securityinsight.models.FieldMapping]
"""
_attribute_map = {
- "content_type": {"key": "contentType", "type": "str"},
- "path": {"key": "path", "type": "str"},
+ "entity_type": {"key": "entityType", "type": "str"},
+ "field_mappings": {"key": "fieldMappings", "type": "[FieldMapping]"},
}
def __init__(
- self, *, content_type: Optional[Union[str, "_models.ContentType"]] = None, path: Optional[str] = None, **kwargs
- ):
+ self,
+ *,
+ entity_type: Optional[Union[str, "_models.EntityMappingType"]] = None,
+ field_mappings: Optional[List["_models.FieldMapping"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword content_type: Content type. Known values are: "AnalyticRule" and "Workbook".
- :paramtype content_type: str or ~azure.mgmt.securityinsight.models.ContentType
- :keyword path: The path to the content.
- :paramtype path: str
+ :keyword entity_type: The V3 type of the mapped entity. Known values are: "Account", "Host",
+ "IP", "Malware", "File", "Process", "CloudApplication", "DNS", "AzureResource", "FileHash",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "Mailbox", "MailCluster",
+ "MailMessage", and "SubmissionMail".
+ :paramtype entity_type: str or ~azure.mgmt.securityinsight.models.EntityMappingType
+ :keyword field_mappings: array of field mappings for the given entity mapping.
+ :paramtype field_mappings: list[~azure.mgmt.securityinsight.models.FieldMapping]
"""
super().__init__(**kwargs)
- self.content_type = content_type
- self.path = path
+ self.entity_type = entity_type
+ self.field_mappings = field_mappings
-class CustomsPermission(_serialization.Model):
- """Customs permissions required for the connector.
+class ErrorAdditionalInfo(_serialization.Model):
+ """The resource management error additional info.
- :ivar name: Customs permissions name.
- :vartype name: str
- :ivar description: Customs permissions description.
- :vartype description: str
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar type: The additional info type.
+ :vartype type: str
+ :ivar info: The additional info.
+ :vartype info: JSON
"""
+ _validation = {
+ "type": {"readonly": True},
+ "info": {"readonly": True},
+ }
+
_attribute_map = {
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "info": {"key": "info", "type": "object"},
}
- def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs):
- """
- :keyword name: Customs permissions name.
- :paramtype name: str
- :keyword description: Customs permissions description.
- :paramtype description: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.name = name
- self.description = description
+ self.type = None
+ self.info = None
-class Customs(CustomsPermission):
- """Customs permissions required for the connector.
+class ErrorDetail(_serialization.Model):
+ """The error detail.
- :ivar name: Customs permissions name.
- :vartype name: str
- :ivar description: Customs permissions description.
- :vartype description: str
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar target: The error target.
+ :vartype target: str
+ :ivar details: The error details.
+ :vartype details: list[~azure.mgmt.securityinsight.models.ErrorDetail]
+ :ivar additional_info: The error additional info.
+ :vartype additional_info: list[~azure.mgmt.securityinsight.models.ErrorAdditionalInfo]
"""
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ _validation = {
+ "code": {"readonly": True},
+ "message": {"readonly": True},
+ "target": {"readonly": True},
+ "details": {"readonly": True},
+ "additional_info": {"readonly": True},
}
- def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs):
- """
- :keyword name: Customs permissions name.
- :paramtype name: str
- :keyword description: Customs permissions description.
- :paramtype description: str
- """
- super().__init__(name=name, description=description, **kwargs)
-
-
-class DataConnectorConnectBody(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Represents Codeless API Polling data connector.
-
- :ivar kind: The authentication kind used to poll the data. Known values are: "Basic", "OAuth2",
- and "APIKey".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.ConnectAuthKind
- :ivar api_key: The API key of the audit server.
- :vartype api_key: str
- :ivar data_collection_endpoint: Used in v2 logs connector. Represents the data collection
- ingestion endpoint in log analytics.
- :vartype data_collection_endpoint: str
- :ivar data_collection_rule_immutable_id: Used in v2 logs connector. The data collection rule
- immutable id, the rule defines the transformation and data destination.
- :vartype data_collection_rule_immutable_id: str
- :ivar output_stream: Used in v2 logs connector. The stream we are sending the data to, this is
- the name of the streamDeclarations defined in the DCR.
- :vartype output_stream: str
- :ivar client_secret: The client secret of the OAuth 2.0 application.
- :vartype client_secret: str
- :ivar client_id: The client id of the OAuth 2.0 application.
- :vartype client_id: str
- :ivar authorization_code: The authorization code used in OAuth 2.0 code flow to issue a token.
- :vartype authorization_code: str
- :ivar user_name: The user name in the audit log server.
- :vartype user_name: str
- :ivar password: The user password in the audit log server.
- :vartype password: str
- :ivar request_config_user_input_values:
- :vartype request_config_user_input_values: list[JSON]
- """
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "api_key": {"key": "apiKey", "type": "str"},
- "data_collection_endpoint": {"key": "dataCollectionEndpoint", "type": "str"},
- "data_collection_rule_immutable_id": {"key": "dataCollectionRuleImmutableId", "type": "str"},
- "output_stream": {"key": "outputStream", "type": "str"},
- "client_secret": {"key": "clientSecret", "type": "str"},
- "client_id": {"key": "clientId", "type": "str"},
- "authorization_code": {"key": "authorizationCode", "type": "str"},
- "user_name": {"key": "userName", "type": "str"},
- "password": {"key": "password", "type": "str"},
- "request_config_user_input_values": {"key": "requestConfigUserInputValues", "type": "[object]"},
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "target": {"key": "target", "type": "str"},
+ "details": {"key": "details", "type": "[ErrorDetail]"},
+ "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
}
- def __init__(
- self,
- *,
- kind: Optional[Union[str, "_models.ConnectAuthKind"]] = None,
- api_key: Optional[str] = None,
- data_collection_endpoint: Optional[str] = None,
- data_collection_rule_immutable_id: Optional[str] = None,
- output_stream: Optional[str] = None,
- client_secret: Optional[str] = None,
- client_id: Optional[str] = None,
- authorization_code: Optional[str] = None,
- user_name: Optional[str] = None,
- password: Optional[str] = None,
- request_config_user_input_values: Optional[List[JSON]] = None,
- **kwargs
- ):
- """
- :keyword kind: The authentication kind used to poll the data. Known values are: "Basic",
- "OAuth2", and "APIKey".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.ConnectAuthKind
- :keyword api_key: The API key of the audit server.
- :paramtype api_key: str
- :keyword data_collection_endpoint: Used in v2 logs connector. Represents the data collection
- ingestion endpoint in log analytics.
- :paramtype data_collection_endpoint: str
- :keyword data_collection_rule_immutable_id: Used in v2 logs connector. The data collection rule
- immutable id, the rule defines the transformation and data destination.
- :paramtype data_collection_rule_immutable_id: str
- :keyword output_stream: Used in v2 logs connector. The stream we are sending the data to, this
- is the name of the streamDeclarations defined in the DCR.
- :paramtype output_stream: str
- :keyword client_secret: The client secret of the OAuth 2.0 application.
- :paramtype client_secret: str
- :keyword client_id: The client id of the OAuth 2.0 application.
- :paramtype client_id: str
- :keyword authorization_code: The authorization code used in OAuth 2.0 code flow to issue a
- token.
- :paramtype authorization_code: str
- :keyword user_name: The user name in the audit log server.
- :paramtype user_name: str
- :keyword password: The user password in the audit log server.
- :paramtype password: str
- :keyword request_config_user_input_values:
- :paramtype request_config_user_input_values: list[JSON]
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.kind = kind
- self.api_key = api_key
- self.data_collection_endpoint = data_collection_endpoint
- self.data_collection_rule_immutable_id = data_collection_rule_immutable_id
- self.output_stream = output_stream
- self.client_secret = client_secret
- self.client_id = client_id
- self.authorization_code = authorization_code
- self.user_name = user_name
- self.password = password
- self.request_config_user_input_values = request_config_user_input_values
-
-
-class DataConnectorList(_serialization.Model):
- """List all the data connectors.
+ self.code = None
+ self.message = None
+ self.target = None
+ self.details = None
+ self.additional_info = None
- 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.
+class ErrorResponse(_serialization.Model):
+ """Common error response for all Azure Resource Manager APIs to return error details for failed
+ operations. (This also follows the OData error response format.).
- :ivar next_link: URL to fetch the next set of data connectors.
- :vartype next_link: str
- :ivar value: Array of data connectors. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.DataConnector]
+ :ivar error: The error object.
+ :vartype error: ~azure.mgmt.securityinsight.models.ErrorDetail
"""
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[DataConnector]"},
+ "error": {"key": "error", "type": "ErrorDetail"},
}
- def __init__(self, *, value: List["_models.DataConnector"], **kwargs):
+ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None:
"""
- :keyword value: Array of data connectors. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.DataConnector]
+ :keyword error: The error object.
+ :paramtype error: ~azure.mgmt.securityinsight.models.ErrorDetail
"""
super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ self.error = error
-class DataConnectorRequirementsState(_serialization.Model):
- """Data connector requirements status.
+class EventGroupingSettings(_serialization.Model):
+ """Event grouping settings property bag.
- :ivar authorization_state: Authorization state for this connector. Known values are: "Valid"
- and "Invalid".
- :vartype authorization_state: str or
- ~azure.mgmt.securityinsight.models.DataConnectorAuthorizationState
- :ivar license_state: License state for this connector. Known values are: "Valid", "Invalid",
- and "Unknown".
- :vartype license_state: str or ~azure.mgmt.securityinsight.models.DataConnectorLicenseState
+ :ivar aggregation_kind: The event grouping aggregation kinds. Known values are: "SingleAlert"
+ and "AlertPerResult".
+ :vartype aggregation_kind: str or
+ ~azure.mgmt.securityinsight.models.EventGroupingAggregationKind
"""
_attribute_map = {
- "authorization_state": {"key": "authorizationState", "type": "str"},
- "license_state": {"key": "licenseState", "type": "str"},
+ "aggregation_kind": {"key": "aggregationKind", "type": "str"},
}
def __init__(
- self,
- *,
- authorization_state: Optional[Union[str, "_models.DataConnectorAuthorizationState"]] = None,
- license_state: Optional[Union[str, "_models.DataConnectorLicenseState"]] = None,
- **kwargs
- ):
- """
- :keyword authorization_state: Authorization state for this connector. Known values are: "Valid"
- and "Invalid".
- :paramtype authorization_state: str or
- ~azure.mgmt.securityinsight.models.DataConnectorAuthorizationState
- :keyword license_state: License state for this connector. Known values are: "Valid", "Invalid",
- and "Unknown".
- :paramtype license_state: str or ~azure.mgmt.securityinsight.models.DataConnectorLicenseState
+ self, *, aggregation_kind: Optional[Union[str, "_models.EventGroupingAggregationKind"]] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword aggregation_kind: The event grouping aggregation kinds. Known values are:
+ "SingleAlert" and "AlertPerResult".
+ :paramtype aggregation_kind: str or
+ ~azure.mgmt.securityinsight.models.EventGroupingAggregationKind
"""
super().__init__(**kwargs)
- self.authorization_state = authorization_state
- self.license_state = license_state
+ self.aggregation_kind = aggregation_kind
-class DataTypeDefinitions(_serialization.Model):
- """The data type definition.
+class FieldMapping(_serialization.Model):
+ """A single field mapping of the mapped entity.
- :ivar data_type: The data type name.
- :vartype data_type: str
+ :ivar identifier: the V3 identifier of the entity.
+ :vartype identifier: str
+ :ivar column_name: the column name to be mapped to the identifier.
+ :vartype column_name: str
"""
_attribute_map = {
- "data_type": {"key": "dataType", "type": "str"},
+ "identifier": {"key": "identifier", "type": "str"},
+ "column_name": {"key": "columnName", "type": "str"},
}
- def __init__(self, *, data_type: Optional[str] = None, **kwargs):
+ def __init__(self, *, identifier: Optional[str] = None, column_name: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword data_type: The data type name.
- :paramtype data_type: str
+ :keyword identifier: the V3 identifier of the entity.
+ :paramtype identifier: str
+ :keyword column_name: the column name to be mapped to the identifier.
+ :paramtype column_name: str
"""
super().__init__(**kwargs)
- self.data_type = data_type
+ self.identifier = identifier
+ self.column_name = column_name
-class Deployment(_serialization.Model):
- """Description about a deployment.
-
- :ivar deployment_id: Deployment identifier.
- :vartype deployment_id: str
- :ivar deployment_state: Current status of the deployment. Known values are: "In_Progress",
- "Completed", "Queued", and "Canceling".
- :vartype deployment_state: str or ~azure.mgmt.securityinsight.models.DeploymentState
- :ivar deployment_result: The outcome of the deployment. Known values are: "Success",
- "Canceled", and "Failed".
- :vartype deployment_result: str or ~azure.mgmt.securityinsight.models.DeploymentResult
- :ivar deployment_time: The time when the deployment finished.
- :vartype deployment_time: ~datetime.datetime
- :ivar deployment_logs_url: Url to access repository action logs.
- :vartype deployment_logs_url: str
- """
-
- _attribute_map = {
- "deployment_id": {"key": "deploymentId", "type": "str"},
- "deployment_state": {"key": "deploymentState", "type": "str"},
- "deployment_result": {"key": "deploymentResult", "type": "str"},
- "deployment_time": {"key": "deploymentTime", "type": "iso-8601"},
- "deployment_logs_url": {"key": "deploymentLogsUrl", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- deployment_id: Optional[str] = None,
- deployment_state: Optional[Union[str, "_models.DeploymentState"]] = None,
- deployment_result: Optional[Union[str, "_models.DeploymentResult"]] = None,
- deployment_time: Optional[datetime.datetime] = None,
- deployment_logs_url: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword deployment_id: Deployment identifier.
- :paramtype deployment_id: str
- :keyword deployment_state: Current status of the deployment. Known values are: "In_Progress",
- "Completed", "Queued", and "Canceling".
- :paramtype deployment_state: str or ~azure.mgmt.securityinsight.models.DeploymentState
- :keyword deployment_result: The outcome of the deployment. Known values are: "Success",
- "Canceled", and "Failed".
- :paramtype deployment_result: str or ~azure.mgmt.securityinsight.models.DeploymentResult
- :keyword deployment_time: The time when the deployment finished.
- :paramtype deployment_time: ~datetime.datetime
- :keyword deployment_logs_url: Url to access repository action logs.
- :paramtype deployment_logs_url: str
- """
- super().__init__(**kwargs)
- self.deployment_id = deployment_id
- self.deployment_state = deployment_state
- self.deployment_result = deployment_result
- self.deployment_time = deployment_time
- self.deployment_logs_url = deployment_logs_url
-
-
-class DeploymentInfo(_serialization.Model):
- """Information regarding a deployment.
-
- :ivar deployment_fetch_status: Status while fetching the last deployment. Known values are:
- "Success", "Unauthorized", and "NotFound".
- :vartype deployment_fetch_status: str or
- ~azure.mgmt.securityinsight.models.DeploymentFetchStatus
- :ivar deployment: Deployment information.
- :vartype deployment: ~azure.mgmt.securityinsight.models.Deployment
- :ivar message: Additional details about the deployment that can be shown to the user.
- :vartype message: str
- """
-
- _attribute_map = {
- "deployment_fetch_status": {"key": "deploymentFetchStatus", "type": "str"},
- "deployment": {"key": "deployment", "type": "Deployment"},
- "message": {"key": "message", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- deployment_fetch_status: Optional[Union[str, "_models.DeploymentFetchStatus"]] = None,
- deployment: Optional["_models.Deployment"] = None,
- message: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword deployment_fetch_status: Status while fetching the last deployment. Known values are:
- "Success", "Unauthorized", and "NotFound".
- :paramtype deployment_fetch_status: str or
- ~azure.mgmt.securityinsight.models.DeploymentFetchStatus
- :keyword deployment: Deployment information.
- :paramtype deployment: ~azure.mgmt.securityinsight.models.Deployment
- :keyword message: Additional details about the deployment that can be shown to the user.
- :paramtype message: str
- """
- super().__init__(**kwargs)
- self.deployment_fetch_status = deployment_fetch_status
- self.deployment = deployment
- self.message = message
-
-
-class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a dns entity.
+class FileEntity(Entity):
+ """Represents a file entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -6474,22 +4432,22 @@ class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar dns_server_ip_entity_id: An ip entity id for the dns server resolving the request.
- :vartype dns_server_ip_entity_id: str
- :ivar domain_name: The name of the dns record associated with the alert.
- :vartype domain_name: str
- :ivar host_ip_address_entity_id: An ip entity id for the dns request client.
- :vartype host_ip_address_entity_id: str
- :ivar ip_address_entity_ids: Ip entity identifiers for the resolved ip address.
- :vartype ip_address_entity_ids: list[str]
+ :ivar directory: The full path to the file.
+ :vartype directory: str
+ :ivar file_hash_entity_ids: The file hash entity identifiers associated with this file.
+ :vartype file_hash_entity_ids: list[str]
+ :ivar file_name: The file name without path (some alerts might not include path).
+ :vartype file_name: str
+ :ivar host_entity_id: The Host entity id which the file belongs to.
+ :vartype host_entity_id: str
"""
_validation = {
@@ -6500,10 +4458,10 @@ class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"required": True},
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- "dns_server_ip_entity_id": {"readonly": True},
- "domain_name": {"readonly": True},
- "host_ip_address_entity_id": {"readonly": True},
- "ip_address_entity_ids": {"readonly": True},
+ "directory": {"readonly": True},
+ "file_hash_entity_ids": {"readonly": True},
+ "file_name": {"readonly": True},
+ "host_entity_id": {"readonly": True},
}
_attribute_map = {
@@ -6514,26 +4472,26 @@ class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"key": "kind", "type": "str"},
"additional_data": {"key": "properties.additionalData", "type": "{object}"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "dns_server_ip_entity_id": {"key": "properties.dnsServerIpEntityId", "type": "str"},
- "domain_name": {"key": "properties.domainName", "type": "str"},
- "host_ip_address_entity_id": {"key": "properties.hostIpAddressEntityId", "type": "str"},
- "ip_address_entity_ids": {"key": "properties.ipAddressEntityIds", "type": "[str]"},
+ "directory": {"key": "properties.directory", "type": "str"},
+ "file_hash_entity_ids": {"key": "properties.fileHashEntityIds", "type": "[str]"},
+ "file_name": {"key": "properties.fileName", "type": "str"},
+ "host_entity_id": {"key": "properties.hostEntityId", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
- self.kind: str = "DnsResolution"
+ self.kind: str = "File"
self.additional_data = None
self.friendly_name = None
- self.dns_server_ip_entity_id = None
- self.domain_name = None
- self.host_ip_address_entity_id = None
- self.ip_address_entity_ids = None
+ self.directory = None
+ self.file_hash_entity_ids = None
+ self.file_name = None
+ self.host_entity_id = None
-class DnsEntityProperties(EntityCommonProperties):
- """Dns entity property bag.
+class FileEntityProperties(EntityCommonProperties):
+ """File entity property bag.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -6543,113 +4501,52 @@ class DnsEntityProperties(EntityCommonProperties):
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar dns_server_ip_entity_id: An ip entity id for the dns server resolving the request.
- :vartype dns_server_ip_entity_id: str
- :ivar domain_name: The name of the dns record associated with the alert.
- :vartype domain_name: str
- :ivar host_ip_address_entity_id: An ip entity id for the dns request client.
- :vartype host_ip_address_entity_id: str
- :ivar ip_address_entity_ids: Ip entity identifiers for the resolved ip address.
- :vartype ip_address_entity_ids: list[str]
+ :ivar directory: The full path to the file.
+ :vartype directory: str
+ :ivar file_hash_entity_ids: The file hash entity identifiers associated with this file.
+ :vartype file_hash_entity_ids: list[str]
+ :ivar file_name: The file name without path (some alerts might not include path).
+ :vartype file_name: str
+ :ivar host_entity_id: The Host entity id which the file belongs to.
+ :vartype host_entity_id: str
"""
_validation = {
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- "dns_server_ip_entity_id": {"readonly": True},
- "domain_name": {"readonly": True},
- "host_ip_address_entity_id": {"readonly": True},
- "ip_address_entity_ids": {"readonly": True},
+ "directory": {"readonly": True},
+ "file_hash_entity_ids": {"readonly": True},
+ "file_name": {"readonly": True},
+ "host_entity_id": {"readonly": True},
}
_attribute_map = {
"additional_data": {"key": "additionalData", "type": "{object}"},
"friendly_name": {"key": "friendlyName", "type": "str"},
- "dns_server_ip_entity_id": {"key": "dnsServerIpEntityId", "type": "str"},
- "domain_name": {"key": "domainName", "type": "str"},
- "host_ip_address_entity_id": {"key": "hostIpAddressEntityId", "type": "str"},
- "ip_address_entity_ids": {"key": "ipAddressEntityIds", "type": "[str]"},
+ "directory": {"key": "directory", "type": "str"},
+ "file_hash_entity_ids": {"key": "fileHashEntityIds", "type": "[str]"},
+ "file_name": {"key": "fileName", "type": "str"},
+ "host_entity_id": {"key": "hostEntityId", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
- self.dns_server_ip_entity_id = None
- self.domain_name = None
- self.host_ip_address_entity_id = None
- self.ip_address_entity_ids = None
-
-
-class Dynamics365CheckRequirements(DataConnectorsCheckRequirements):
- """Represents Dynamics365 requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "Dynamics365"
- self.tenant_id = tenant_id
-
-
-class Dynamics365CheckRequirementsProperties(DataConnectorTenantId):
- """Dynamics365 requirements check properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
+ self.directory = None
+ self.file_hash_entity_ids = None
+ self.file_name = None
+ self.host_entity_id = None
-class Dynamics365DataConnector(DataConnector):
- """Represents Dynamics365 data connector.
+class FileHashEntity(Entity):
+ """Represents a file hash entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -6659,20 +4556,22 @@ class Dynamics365DataConnector(DataConnector):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypes
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar algorithm: The hash algorithm type. Known values are: "Unknown", "MD5", "SHA1", "SHA256",
+ and "SHA256AC".
+ :vartype algorithm: str or ~azure.mgmt.securityinsight.models.FileHashAlgorithm
+ :ivar hash_value: The file hash value.
+ :vartype hash_value: str
"""
_validation = {
@@ -6681,6 +4580,10 @@ class Dynamics365DataConnector(DataConnector):
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "algorithm": {"readonly": True},
+ "hash_value": {"readonly": True},
}
_attribute_map = {
@@ -6688,582 +4591,71 @@ class Dynamics365DataConnector(DataConnector):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "Dynamics365DataConnectorDataTypes"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "algorithm": {"key": "properties.algorithm", "type": "str"},
+ "hash_value": {"key": "properties.hashValue", "type": "str"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.Dynamics365DataConnectorDataTypes"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypes
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Dynamics365"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
-
-class Dynamics365DataConnectorDataTypes(_serialization.Model):
- """The available data types for Dynamics365 data connector.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar dynamics365_cds_activities: Common Data Service data type connection. Required.
- :vartype dynamics365_cds_activities:
- ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities
- """
-
- _validation = {
- "dynamics365_cds_activities": {"required": True},
- }
-
- _attribute_map = {
- "dynamics365_cds_activities": {
- "key": "dynamics365CdsActivities",
- "type": "Dynamics365DataConnectorDataTypesDynamics365CdsActivities",
- },
- }
-
- def __init__(
- self,
- *,
- dynamics365_cds_activities: "_models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities",
- **kwargs
- ):
- """
- :keyword dynamics365_cds_activities: Common Data Service data type connection. Required.
- :paramtype dynamics365_cds_activities:
- ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.dynamics365_cds_activities = dynamics365_cds_activities
-
-
-class Dynamics365DataConnectorDataTypesDynamics365CdsActivities(DataConnectorDataTypeCommon):
- """Common Data Service data type connection.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
-
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
- super().__init__(state=state, **kwargs)
+ self.kind: str = "FileHash"
+ self.additional_data = None
+ self.friendly_name = None
+ self.algorithm = None
+ self.hash_value = None
-class Dynamics365DataConnectorProperties(DataConnectorTenantId):
- """Dynamics365 data connector properties.
+class FileHashEntityProperties(EntityCommonProperties):
+ """FileHash entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypes
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar algorithm: The hash algorithm type. Known values are: "Unknown", "MD5", "SHA1", "SHA256",
+ and "SHA256AC".
+ :vartype algorithm: str or ~azure.mgmt.securityinsight.models.FileHashAlgorithm
+ :ivar hash_value: The file hash value.
+ :vartype hash_value: str
"""
_validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "Dynamics365DataConnectorDataTypes"},
- }
-
- def __init__(self, *, tenant_id: str, data_types: "_models.Dynamics365DataConnectorDataTypes", **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypes
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
-
-class EnrichmentDomainWhois(_serialization.Model):
- """Whois information for a given domain and associated metadata.
-
- :ivar domain: The domain for this whois record.
- :vartype domain: str
- :ivar server: The hostname of this registrar's whois server.
- :vartype server: str
- :ivar created: The timestamp at which this record was created.
- :vartype created: ~datetime.datetime
- :ivar updated: The timestamp at which this record was last updated.
- :vartype updated: ~datetime.datetime
- :ivar expires: The timestamp at which this record will expire.
- :vartype expires: ~datetime.datetime
- :ivar parsed_whois: The whois record for a given domain.
- :vartype parsed_whois: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisDetails
- """
-
- _attribute_map = {
- "domain": {"key": "domain", "type": "str"},
- "server": {"key": "server", "type": "str"},
- "created": {"key": "created", "type": "iso-8601"},
- "updated": {"key": "updated", "type": "iso-8601"},
- "expires": {"key": "expires", "type": "iso-8601"},
- "parsed_whois": {"key": "parsedWhois", "type": "EnrichmentDomainWhoisDetails"},
- }
-
- def __init__(
- self,
- *,
- domain: Optional[str] = None,
- server: Optional[str] = None,
- created: Optional[datetime.datetime] = None,
- updated: Optional[datetime.datetime] = None,
- expires: Optional[datetime.datetime] = None,
- parsed_whois: Optional["_models.EnrichmentDomainWhoisDetails"] = None,
- **kwargs
- ):
- """
- :keyword domain: The domain for this whois record.
- :paramtype domain: str
- :keyword server: The hostname of this registrar's whois server.
- :paramtype server: str
- :keyword created: The timestamp at which this record was created.
- :paramtype created: ~datetime.datetime
- :keyword updated: The timestamp at which this record was last updated.
- :paramtype updated: ~datetime.datetime
- :keyword expires: The timestamp at which this record will expire.
- :paramtype expires: ~datetime.datetime
- :keyword parsed_whois: The whois record for a given domain.
- :paramtype parsed_whois: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisDetails
- """
- super().__init__(**kwargs)
- self.domain = domain
- self.server = server
- self.created = created
- self.updated = updated
- self.expires = expires
- self.parsed_whois = parsed_whois
-
-
-class EnrichmentDomainWhoisContact(_serialization.Model):
- """An individual contact associated with this domain.
-
- :ivar name: The name of this contact.
- :vartype name: str
- :ivar org: The organization for this contact.
- :vartype org: str
- :ivar street: A list describing the street address for this contact.
- :vartype street: list[str]
- :ivar city: The city for this contact.
- :vartype city: str
- :ivar state: The state for this contact.
- :vartype state: str
- :ivar postal: The postal code for this contact.
- :vartype postal: str
- :ivar country: The country for this contact.
- :vartype country: str
- :ivar phone: The phone number for this contact.
- :vartype phone: str
- :ivar fax: The fax number for this contact.
- :vartype fax: str
- :ivar email: The email address for this contact.
- :vartype email: str
- """
-
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "org": {"key": "org", "type": "str"},
- "street": {"key": "street", "type": "[str]"},
- "city": {"key": "city", "type": "str"},
- "state": {"key": "state", "type": "str"},
- "postal": {"key": "postal", "type": "str"},
- "country": {"key": "country", "type": "str"},
- "phone": {"key": "phone", "type": "str"},
- "fax": {"key": "fax", "type": "str"},
- "email": {"key": "email", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- name: Optional[str] = None,
- org: Optional[str] = None,
- street: Optional[List[str]] = None,
- city: Optional[str] = None,
- state: Optional[str] = None,
- postal: Optional[str] = None,
- country: Optional[str] = None,
- phone: Optional[str] = None,
- fax: Optional[str] = None,
- email: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword name: The name of this contact.
- :paramtype name: str
- :keyword org: The organization for this contact.
- :paramtype org: str
- :keyword street: A list describing the street address for this contact.
- :paramtype street: list[str]
- :keyword city: The city for this contact.
- :paramtype city: str
- :keyword state: The state for this contact.
- :paramtype state: str
- :keyword postal: The postal code for this contact.
- :paramtype postal: str
- :keyword country: The country for this contact.
- :paramtype country: str
- :keyword phone: The phone number for this contact.
- :paramtype phone: str
- :keyword fax: The fax number for this contact.
- :paramtype fax: str
- :keyword email: The email address for this contact.
- :paramtype email: str
- """
- super().__init__(**kwargs)
- self.name = name
- self.org = org
- self.street = street
- self.city = city
- self.state = state
- self.postal = postal
- self.country = country
- self.phone = phone
- self.fax = fax
- self.email = email
-
-
-class EnrichmentDomainWhoisContacts(_serialization.Model):
- """The set of contacts associated with this domain.
-
- :ivar admin: The admin contact for this whois record.
- :vartype admin: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- :ivar billing: The billing contact for this whois record.
- :vartype billing: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- :ivar registrant: The registrant contact for this whois record.
- :vartype registrant: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- :ivar tech: The technical contact for this whois record.
- :vartype tech: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- """
-
- _attribute_map = {
- "admin": {"key": "admin", "type": "EnrichmentDomainWhoisContact"},
- "billing": {"key": "billing", "type": "EnrichmentDomainWhoisContact"},
- "registrant": {"key": "registrant", "type": "EnrichmentDomainWhoisContact"},
- "tech": {"key": "tech", "type": "EnrichmentDomainWhoisContact"},
- }
-
- def __init__(
- self,
- *,
- admin: Optional["_models.EnrichmentDomainWhoisContact"] = None,
- billing: Optional["_models.EnrichmentDomainWhoisContact"] = None,
- registrant: Optional["_models.EnrichmentDomainWhoisContact"] = None,
- tech: Optional["_models.EnrichmentDomainWhoisContact"] = None,
- **kwargs
- ):
- """
- :keyword admin: The admin contact for this whois record.
- :paramtype admin: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- :keyword billing: The billing contact for this whois record.
- :paramtype billing: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- :keyword registrant: The registrant contact for this whois record.
- :paramtype registrant: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- :keyword tech: The technical contact for this whois record.
- :paramtype tech: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContact
- """
- super().__init__(**kwargs)
- self.admin = admin
- self.billing = billing
- self.registrant = registrant
- self.tech = tech
-
-
-class EnrichmentDomainWhoisDetails(_serialization.Model):
- """The whois record for a given domain.
-
- :ivar registrar: The registrar associated with this domain.
- :vartype registrar: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisRegistrarDetails
- :ivar contacts: The set of contacts associated with this domain.
- :vartype contacts: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContacts
- :ivar name_servers: A list of name servers associated with this domain.
- :vartype name_servers: list[str]
- :ivar statuses: The set of status flags for this whois record.
- :vartype statuses: list[str]
- """
-
- _attribute_map = {
- "registrar": {"key": "registrar", "type": "EnrichmentDomainWhoisRegistrarDetails"},
- "contacts": {"key": "contacts", "type": "EnrichmentDomainWhoisContacts"},
- "name_servers": {"key": "nameServers", "type": "[str]"},
- "statuses": {"key": "statuses", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- registrar: Optional["_models.EnrichmentDomainWhoisRegistrarDetails"] = None,
- contacts: Optional["_models.EnrichmentDomainWhoisContacts"] = None,
- name_servers: Optional[List[str]] = None,
- statuses: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword registrar: The registrar associated with this domain.
- :paramtype registrar: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisRegistrarDetails
- :keyword contacts: The set of contacts associated with this domain.
- :paramtype contacts: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhoisContacts
- :keyword name_servers: A list of name servers associated with this domain.
- :paramtype name_servers: list[str]
- :keyword statuses: The set of status flags for this whois record.
- :paramtype statuses: list[str]
- """
- super().__init__(**kwargs)
- self.registrar = registrar
- self.contacts = contacts
- self.name_servers = name_servers
- self.statuses = statuses
-
-
-class EnrichmentDomainWhoisRegistrarDetails(_serialization.Model):
- """The registrar associated with this domain.
-
- :ivar name: The name of this registrar.
- :vartype name: str
- :ivar abuse_contact_email: This registrar's abuse contact email.
- :vartype abuse_contact_email: str
- :ivar abuse_contact_phone: This registrar's abuse contact phone number.
- :vartype abuse_contact_phone: str
- :ivar iana_id: This registrar's Internet Assigned Numbers Authority id.
- :vartype iana_id: str
- :ivar url: This registrar's URL.
- :vartype url: str
- :ivar whois_server: The hostname of this registrar's whois server.
- :vartype whois_server: str
- """
-
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "abuse_contact_email": {"key": "abuseContactEmail", "type": "str"},
- "abuse_contact_phone": {"key": "abuseContactPhone", "type": "str"},
- "iana_id": {"key": "ianaId", "type": "str"},
- "url": {"key": "url", "type": "str"},
- "whois_server": {"key": "whoisServer", "type": "str"},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "algorithm": {"readonly": True},
+ "hash_value": {"readonly": True},
}
- def __init__(
- self,
- *,
- name: Optional[str] = None,
- abuse_contact_email: Optional[str] = None,
- abuse_contact_phone: Optional[str] = None,
- iana_id: Optional[str] = None,
- url: Optional[str] = None,
- whois_server: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword name: The name of this registrar.
- :paramtype name: str
- :keyword abuse_contact_email: This registrar's abuse contact email.
- :paramtype abuse_contact_email: str
- :keyword abuse_contact_phone: This registrar's abuse contact phone number.
- :paramtype abuse_contact_phone: str
- :keyword iana_id: This registrar's Internet Assigned Numbers Authority id.
- :paramtype iana_id: str
- :keyword url: This registrar's URL.
- :paramtype url: str
- :keyword whois_server: The hostname of this registrar's whois server.
- :paramtype whois_server: str
- """
- super().__init__(**kwargs)
- self.name = name
- self.abuse_contact_email = abuse_contact_email
- self.abuse_contact_phone = abuse_contact_phone
- self.iana_id = iana_id
- self.url = url
- self.whois_server = whois_server
-
-
-class EnrichmentIpGeodata(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Geodata information for a given IP address.
-
- :ivar asn: The autonomous system number associated with this IP address.
- :vartype asn: str
- :ivar carrier: The name of the carrier for this IP address.
- :vartype carrier: str
- :ivar city: The city this IP address is located in.
- :vartype city: str
- :ivar city_cf: A numeric rating of confidence that the value in the 'city' field is correct, on
- a scale of 0-100.
- :vartype city_cf: int
- :ivar continent: The continent this IP address is located on.
- :vartype continent: str
- :ivar country: The county this IP address is located in.
- :vartype country: str
- :ivar country_cf: A numeric rating of confidence that the value in the 'country' field is
- correct on a scale of 0-100.
- :vartype country_cf: int
- :ivar ip_addr: The dotted-decimal or colon-separated string representation of the IP address.
- :vartype ip_addr: str
- :ivar ip_routing_type: A description of the connection type of this IP address.
- :vartype ip_routing_type: str
- :ivar latitude: The latitude of this IP address.
- :vartype latitude: str
- :ivar longitude: The longitude of this IP address.
- :vartype longitude: str
- :ivar organization: The name of the organization for this IP address.
- :vartype organization: str
- :ivar organization_type: The type of the organization for this IP address.
- :vartype organization_type: str
- :ivar region: The geographic region this IP address is located in.
- :vartype region: str
- :ivar state: The state this IP address is located in.
- :vartype state: str
- :ivar state_cf: A numeric rating of confidence that the value in the 'state' field is correct
- on a scale of 0-100.
- :vartype state_cf: int
- :ivar state_code: The abbreviated name for the state this IP address is located in.
- :vartype state_code: str
- """
-
_attribute_map = {
- "asn": {"key": "asn", "type": "str"},
- "carrier": {"key": "carrier", "type": "str"},
- "city": {"key": "city", "type": "str"},
- "city_cf": {"key": "cityCf", "type": "int"},
- "continent": {"key": "continent", "type": "str"},
- "country": {"key": "country", "type": "str"},
- "country_cf": {"key": "countryCf", "type": "int"},
- "ip_addr": {"key": "ipAddr", "type": "str"},
- "ip_routing_type": {"key": "ipRoutingType", "type": "str"},
- "latitude": {"key": "latitude", "type": "str"},
- "longitude": {"key": "longitude", "type": "str"},
- "organization": {"key": "organization", "type": "str"},
- "organization_type": {"key": "organizationType", "type": "str"},
- "region": {"key": "region", "type": "str"},
- "state": {"key": "state", "type": "str"},
- "state_cf": {"key": "stateCf", "type": "int"},
- "state_code": {"key": "stateCode", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "algorithm": {"key": "algorithm", "type": "str"},
+ "hash_value": {"key": "hashValue", "type": "str"},
}
- def __init__(
- self,
- *,
- asn: Optional[str] = None,
- carrier: Optional[str] = None,
- city: Optional[str] = None,
- city_cf: Optional[int] = None,
- continent: Optional[str] = None,
- country: Optional[str] = None,
- country_cf: Optional[int] = None,
- ip_addr: Optional[str] = None,
- ip_routing_type: Optional[str] = None,
- latitude: Optional[str] = None,
- longitude: Optional[str] = None,
- organization: Optional[str] = None,
- organization_type: Optional[str] = None,
- region: Optional[str] = None,
- state: Optional[str] = None,
- state_cf: Optional[int] = None,
- state_code: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword asn: The autonomous system number associated with this IP address.
- :paramtype asn: str
- :keyword carrier: The name of the carrier for this IP address.
- :paramtype carrier: str
- :keyword city: The city this IP address is located in.
- :paramtype city: str
- :keyword city_cf: A numeric rating of confidence that the value in the 'city' field is correct,
- on a scale of 0-100.
- :paramtype city_cf: int
- :keyword continent: The continent this IP address is located on.
- :paramtype continent: str
- :keyword country: The county this IP address is located in.
- :paramtype country: str
- :keyword country_cf: A numeric rating of confidence that the value in the 'country' field is
- correct on a scale of 0-100.
- :paramtype country_cf: int
- :keyword ip_addr: The dotted-decimal or colon-separated string representation of the IP
- address.
- :paramtype ip_addr: str
- :keyword ip_routing_type: A description of the connection type of this IP address.
- :paramtype ip_routing_type: str
- :keyword latitude: The latitude of this IP address.
- :paramtype latitude: str
- :keyword longitude: The longitude of this IP address.
- :paramtype longitude: str
- :keyword organization: The name of the organization for this IP address.
- :paramtype organization: str
- :keyword organization_type: The type of the organization for this IP address.
- :paramtype organization_type: str
- :keyword region: The geographic region this IP address is located in.
- :paramtype region: str
- :keyword state: The state this IP address is located in.
- :paramtype state: str
- :keyword state_cf: A numeric rating of confidence that the value in the 'state' field is
- correct on a scale of 0-100.
- :paramtype state_cf: int
- :keyword state_code: The abbreviated name for the state this IP address is located in.
- :paramtype state_code: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.asn = asn
- self.carrier = carrier
- self.city = city
- self.city_cf = city_cf
- self.continent = continent
- self.country = country
- self.country_cf = country_cf
- self.ip_addr = ip_addr
- self.ip_routing_type = ip_routing_type
- self.latitude = latitude
- self.longitude = longitude
- self.organization = organization
- self.organization_type = organization_type
- self.region = region
- self.state = state
- self.state_cf = state_cf
- self.state_code = state_code
+ self.algorithm = None
+ self.hash_value = None
-class EntityAnalytics(Settings):
- """Settings with single toggle.
+class FusionAlertRule(AlertRule):
+ """Represents Fusion alert rule.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -7275,11 +4667,26 @@ class EntityAnalytics(Settings):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the setting. Required. Known values are: "Anomalies", "EyesOn",
- "EntityAnalytics", and "Ueba".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SettingKind
- :ivar entity_providers: The relevant entity providers that are synced.
- :vartype entity_providers: list[str or ~azure.mgmt.securityinsight.models.EntityProviders]
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
+ :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
+ :vartype alert_rule_template_name: str
+ :ivar description: The description of the alert rule.
+ :vartype description: str
+ :ivar display_name: The display name for alerts created by this alert rule.
+ :vartype display_name: str
+ :ivar enabled: Determines whether this alert rule is enabled or disabled.
+ :vartype enabled: bool
+ :ivar last_modified_utc: The last time that this alert has been modified.
+ :vartype last_modified_utc: ~datetime.datetime
+ :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
+ "Medium", "Low", and "Informational".
+ :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :ivar tactics: The tactics of the alert rule.
+ :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :ivar techniques: The techniques of the alert rule.
+ :vartype techniques: list[str]
"""
_validation = {
@@ -7288,6 +4695,12 @@ class EntityAnalytics(Settings):
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
+ "description": {"readonly": True},
+ "display_name": {"readonly": True},
+ "last_modified_utc": {"readonly": True},
+ "severity": {"readonly": True},
+ "tactics": {"readonly": True},
+ "techniques": {"readonly": True},
}
_attribute_map = {
@@ -7297,741 +4710,712 @@ class EntityAnalytics(Settings):
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "entity_providers": {"key": "properties.entityProviders", "type": "[str]"},
+ "alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "enabled": {"key": "properties.enabled", "type": "bool"},
+ "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
+ "severity": {"key": "properties.severity", "type": "str"},
+ "tactics": {"key": "properties.tactics", "type": "[str]"},
+ "techniques": {"key": "properties.techniques", "type": "[str]"},
}
def __init__(
self,
*,
etag: Optional[str] = None,
- entity_providers: Optional[List[Union[str, "_models.EntityProviders"]]] = None,
- **kwargs
- ):
+ alert_rule_template_name: Optional[str] = None,
+ enabled: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword entity_providers: The relevant entity providers that are synced.
- :paramtype entity_providers: list[str or ~azure.mgmt.securityinsight.models.EntityProviders]
+ :keyword alert_rule_template_name: The Name of the alert rule template used to create this
+ rule.
+ :paramtype alert_rule_template_name: str
+ :keyword enabled: Determines whether this alert rule is enabled or disabled.
+ :paramtype enabled: bool
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "EntityAnalytics"
- self.entity_providers = entity_providers
+ self.kind: str = "Fusion"
+ self.alert_rule_template_name = alert_rule_template_name
+ self.description = None
+ self.display_name = None
+ self.enabled = enabled
+ self.last_modified_utc = None
+ self.severity = None
+ self.tactics = None
+ self.techniques = None
-class EntityEdges(_serialization.Model):
- """The edge that connects the entity to the other entity.
-
- :ivar target_entity_id: The target entity Id.
- :vartype target_entity_id: str
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- """
-
- _attribute_map = {
- "target_entity_id": {"key": "targetEntityId", "type": "str"},
- "additional_data": {"key": "additionalData", "type": "{object}"},
- }
-
- def __init__(
- self, *, target_entity_id: Optional[str] = None, additional_data: Optional[Dict[str, Any]] = None, **kwargs
- ):
- """
- :keyword target_entity_id: The target entity Id.
- :paramtype target_entity_id: str
- :keyword additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :paramtype additional_data: dict[str, any]
- """
- super().__init__(**kwargs)
- self.target_entity_id = target_entity_id
- self.additional_data = additional_data
+class FusionAlertRuleTemplate(AlertRuleTemplate):
+ """Represents Fusion alert rule template.
+ Variables are only populated by the server, and will be ignored when sending a request.
-class EntityExpandParameters(_serialization.Model):
- """The parameters required to execute an expand operation on the given entity.
+ All required parameters must be populated in order to send to server.
- :ivar end_time: The end date filter, so the only expansion results returned are before this
- date.
- :vartype end_time: ~datetime.datetime
- :ivar expansion_id: The Id of the expansion to perform.
- :vartype expansion_id: str
- :ivar start_time: The start date filter, so the only expansion results returned are after this
- date.
- :vartype start_time: ~datetime.datetime
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
+ :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
+ this template.
+ :vartype alert_rules_created_by_template_count: int
+ :ivar created_date_utc: The time that this alert rule template has been added.
+ :vartype created_date_utc: ~datetime.datetime
+ :ivar last_updated_date_utc: The time that this alert rule template was last updated.
+ :vartype last_updated_date_utc: ~datetime.datetime
+ :ivar description: The description of the alert rule template.
+ :vartype description: str
+ :ivar display_name: The display name for alert rule template.
+ :vartype display_name: str
+ :ivar required_data_connectors: The required data connectors for this template.
+ :vartype required_data_connectors:
+ list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
+ :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
+ "NotAvailable".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
+ :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
+ "Medium", "Low", and "Informational".
+ :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :ivar tactics: The tactics of the alert rule template.
+ :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :ivar techniques: The techniques of the alert rule template.
+ :vartype techniques: list[str]
"""
- _attribute_map = {
- "end_time": {"key": "endTime", "type": "iso-8601"},
- "expansion_id": {"key": "expansionId", "type": "str"},
- "start_time": {"key": "startTime", "type": "iso-8601"},
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
+ "created_date_utc": {"readonly": True},
+ "last_updated_date_utc": {"readonly": True},
}
- def __init__(
- self,
- *,
- end_time: Optional[datetime.datetime] = None,
- expansion_id: Optional[str] = None,
- start_time: Optional[datetime.datetime] = None,
- **kwargs
- ):
- """
- :keyword end_time: The end date filter, so the only expansion results returned are before this
- date.
- :paramtype end_time: ~datetime.datetime
- :keyword expansion_id: The Id of the expansion to perform.
- :paramtype expansion_id: str
- :keyword start_time: The start date filter, so the only expansion results returned are after
- this date.
- :paramtype start_time: ~datetime.datetime
- """
- super().__init__(**kwargs)
- self.end_time = end_time
- self.expansion_id = expansion_id
- self.start_time = start_time
-
-
-class EntityExpandResponse(_serialization.Model):
- """The entity expansion result operation response.
-
- :ivar meta_data: The metadata from the expansion operation results.
- :vartype meta_data: ~azure.mgmt.securityinsight.models.ExpansionResultsMetadata
- :ivar value: The expansion result values.
- :vartype value: ~azure.mgmt.securityinsight.models.EntityExpandResponseValue
- """
-
_attribute_map = {
- "meta_data": {"key": "metaData", "type": "ExpansionResultsMetadata"},
- "value": {"key": "value", "type": "EntityExpandResponseValue"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "kind": {"key": "kind", "type": "str"},
+ "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
+ "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
+ "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
+ "description": {"key": "properties.description", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "required_data_connectors": {
+ "key": "properties.requiredDataConnectors",
+ "type": "[AlertRuleTemplateDataSource]",
+ },
+ "status": {"key": "properties.status", "type": "str"},
+ "severity": {"key": "properties.severity", "type": "str"},
+ "tactics": {"key": "properties.tactics", "type": "[str]"},
+ "techniques": {"key": "properties.techniques", "type": "[str]"},
}
def __init__(
self,
*,
- meta_data: Optional["_models.ExpansionResultsMetadata"] = None,
- value: Optional["_models.EntityExpandResponseValue"] = None,
- **kwargs
- ):
+ alert_rules_created_by_template_count: Optional[int] = None,
+ description: Optional[str] = None,
+ display_name: Optional[str] = None,
+ required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
+ status: Optional[Union[str, "_models.TemplateStatus"]] = None,
+ severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
+ tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
+ techniques: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword meta_data: The metadata from the expansion operation results.
- :paramtype meta_data: ~azure.mgmt.securityinsight.models.ExpansionResultsMetadata
- :keyword value: The expansion result values.
- :paramtype value: ~azure.mgmt.securityinsight.models.EntityExpandResponseValue
+ :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
+ this template.
+ :paramtype alert_rules_created_by_template_count: int
+ :keyword description: The description of the alert rule template.
+ :paramtype description: str
+ :keyword display_name: The display name for alert rule template.
+ :paramtype display_name: str
+ :keyword required_data_connectors: The required data connectors for this template.
+ :paramtype required_data_connectors:
+ list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
+ :keyword status: The alert rule template status. Known values are: "Installed", "Available",
+ and "NotAvailable".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
+ :keyword severity: The severity for alerts created by this alert rule. Known values are:
+ "High", "Medium", "Low", and "Informational".
+ :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :keyword tactics: The tactics of the alert rule template.
+ :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :keyword techniques: The techniques of the alert rule template.
+ :paramtype techniques: list[str]
"""
super().__init__(**kwargs)
- self.meta_data = meta_data
- self.value = value
+ self.kind: str = "Fusion"
+ self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
+ self.created_date_utc = None
+ self.last_updated_date_utc = None
+ self.description = description
+ self.display_name = display_name
+ self.required_data_connectors = required_data_connectors
+ self.status = status
+ self.severity = severity
+ self.tactics = tactics
+ self.techniques = techniques
-class EntityExpandResponseValue(_serialization.Model):
- """The expansion result values.
+class GCPAuthModel(CcpAuthConfig):
+ """Model for API authentication for all GCP kind connectors.
- :ivar entities: Array of the expansion result entities.
- :vartype entities: list[~azure.mgmt.securityinsight.models.Entity]
- :ivar edges: Array of edges that connects the entity to the list of entities.
- :vartype edges: list[~azure.mgmt.securityinsight.models.EntityEdges]
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar service_account_email: GCP Service Account Email. Required.
+ :vartype service_account_email: str
+ :ivar project_number: GCP Project Number. Required.
+ :vartype project_number: str
+ :ivar workload_identity_provider_id: GCP Workload Identity Provider ID. Required.
+ :vartype workload_identity_provider_id: str
"""
- _attribute_map = {
- "entities": {"key": "entities", "type": "[Entity]"},
- "edges": {"key": "edges", "type": "[EntityEdges]"},
+ _validation = {
+ "type": {"required": True},
+ "service_account_email": {"required": True},
+ "project_number": {"required": True},
+ "workload_identity_provider_id": {"required": True},
}
- def __init__(
- self,
- *,
- entities: Optional[List["_models.Entity"]] = None,
- edges: Optional[List["_models.EntityEdges"]] = None,
- **kwargs
- ):
- """
- :keyword entities: Array of the expansion result entities.
- :paramtype entities: list[~azure.mgmt.securityinsight.models.Entity]
- :keyword edges: Array of edges that connects the entity to the list of entities.
- :paramtype edges: list[~azure.mgmt.securityinsight.models.EntityEdges]
- """
- super().__init__(**kwargs)
- self.entities = entities
- self.edges = edges
-
-
-class EntityFieldMapping(_serialization.Model):
- """Map identifiers of a single entity.
-
- :ivar identifier: Alert V3 identifier.
- :vartype identifier: str
- :ivar value: The value of the identifier.
- :vartype value: str
- """
-
_attribute_map = {
- "identifier": {"key": "identifier", "type": "str"},
- "value": {"key": "value", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "service_account_email": {"key": "serviceAccountEmail", "type": "str"},
+ "project_number": {"key": "projectNumber", "type": "str"},
+ "workload_identity_provider_id": {"key": "workloadIdentityProviderId", "type": "str"},
}
- def __init__(self, *, identifier: Optional[str] = None, value: Optional[str] = None, **kwargs):
+ def __init__(
+ self, *, service_account_email: str, project_number: str, workload_identity_provider_id: str, **kwargs: Any
+ ) -> None:
"""
- :keyword identifier: Alert V3 identifier.
- :paramtype identifier: str
- :keyword value: The value of the identifier.
- :paramtype value: str
+ :keyword service_account_email: GCP Service Account Email. Required.
+ :paramtype service_account_email: str
+ :keyword project_number: GCP Project Number. Required.
+ :paramtype project_number: str
+ :keyword workload_identity_provider_id: GCP Workload Identity Provider ID. Required.
+ :paramtype workload_identity_provider_id: str
"""
super().__init__(**kwargs)
- self.identifier = identifier
- self.value = value
+ self.type: str = "GCP"
+ self.service_account_email = service_account_email
+ self.project_number = project_number
+ self.workload_identity_provider_id = workload_identity_provider_id
-class EntityGetInsightsParameters(_serialization.Model):
- """The parameters required to execute insights operation on the given entity.
+class GenericBlobSbsAuthModel(CcpAuthConfig):
+ """Model for API authentication for working with service bus or storage account.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar start_time: The start timeline date, so the results returned are after this date.
- Required.
- :vartype start_time: ~datetime.datetime
- :ivar end_time: The end timeline date, so the results returned are before this date. Required.
- :vartype end_time: ~datetime.datetime
- :ivar add_default_extended_time_range: Indicates if query time range should be extended with
- default time range of the query. Default value is false.
- :vartype add_default_extended_time_range: bool
- :ivar insight_query_ids: List of Insights Query Id. If empty, default value is all insights of
- this entity.
- :vartype insight_query_ids: list[str]
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar credentials_config: Credentials for service bus namespace, keyvault uri for access key.
+ :vartype credentials_config: dict[str, str]
+ :ivar storage_account_credentials_config: Credentials for storage account, keyvault uri for
+ access key.
+ :vartype storage_account_credentials_config: dict[str, str]
"""
_validation = {
- "start_time": {"required": True},
- "end_time": {"required": True},
+ "type": {"required": True},
}
_attribute_map = {
- "start_time": {"key": "startTime", "type": "iso-8601"},
- "end_time": {"key": "endTime", "type": "iso-8601"},
- "add_default_extended_time_range": {"key": "addDefaultExtendedTimeRange", "type": "bool"},
- "insight_query_ids": {"key": "insightQueryIds", "type": "[str]"},
+ "type": {"key": "type", "type": "str"},
+ "credentials_config": {"key": "credentialsConfig", "type": "{str}"},
+ "storage_account_credentials_config": {"key": "storageAccountCredentialsConfig", "type": "{str}"},
}
def __init__(
self,
*,
- start_time: datetime.datetime,
- end_time: datetime.datetime,
- add_default_extended_time_range: Optional[bool] = None,
- insight_query_ids: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword start_time: The start timeline date, so the results returned are after this date.
- Required.
- :paramtype start_time: ~datetime.datetime
- :keyword end_time: The end timeline date, so the results returned are before this date.
- Required.
- :paramtype end_time: ~datetime.datetime
- :keyword add_default_extended_time_range: Indicates if query time range should be extended with
- default time range of the query. Default value is false.
- :paramtype add_default_extended_time_range: bool
- :keyword insight_query_ids: List of Insights Query Id. If empty, default value is all insights
- of this entity.
- :paramtype insight_query_ids: list[str]
+ credentials_config: Optional[Dict[str, str]] = None,
+ storage_account_credentials_config: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword credentials_config: Credentials for service bus namespace, keyvault uri for access
+ key.
+ :paramtype credentials_config: dict[str, str]
+ :keyword storage_account_credentials_config: Credentials for storage account, keyvault uri for
+ access key.
+ :paramtype storage_account_credentials_config: dict[str, str]
"""
super().__init__(**kwargs)
- self.start_time = start_time
- self.end_time = end_time
- self.add_default_extended_time_range = add_default_extended_time_range
- self.insight_query_ids = insight_query_ids
+ self.type: str = "ServiceBus"
+ self.credentials_config = credentials_config
+ self.storage_account_credentials_config = storage_account_credentials_config
-class EntityGetInsightsResponse(_serialization.Model):
- """The Get Insights result operation response.
+class GeoLocation(_serialization.Model):
+ """The geo-location context attached to the ip entity.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar meta_data: The metadata from the get insights operation results.
- :vartype meta_data: ~azure.mgmt.securityinsight.models.GetInsightsResultsMetadata
- :ivar value: The insights result values.
- :vartype value: list[~azure.mgmt.securityinsight.models.EntityInsightItem]
+ :ivar asn: Autonomous System Number.
+ :vartype asn: int
+ :ivar city: City name.
+ :vartype city: str
+ :ivar country_code: The country code according to ISO 3166 format.
+ :vartype country_code: str
+ :ivar country_name: Country name according to ISO 3166 Alpha 2: the lowercase of the English
+ Short Name.
+ :vartype country_name: str
+ :ivar latitude: The longitude of the identified location, expressed as a floating point number
+ with range of -180 to 180, with positive numbers representing East and negative numbers
+ representing West. Latitude and longitude are derived from the city or postal code.
+ :vartype latitude: float
+ :ivar longitude: The latitude of the identified location, expressed as a floating point number
+ with range of - 90 to 90, with positive numbers representing North and negative numbers
+ representing South. Latitude and longitude are derived from the city or postal code.
+ :vartype longitude: float
+ :ivar state: State name.
+ :vartype state: str
"""
+ _validation = {
+ "asn": {"readonly": True},
+ "city": {"readonly": True},
+ "country_code": {"readonly": True},
+ "country_name": {"readonly": True},
+ "latitude": {"readonly": True},
+ "longitude": {"readonly": True},
+ "state": {"readonly": True},
+ }
+
_attribute_map = {
- "meta_data": {"key": "metaData", "type": "GetInsightsResultsMetadata"},
- "value": {"key": "value", "type": "[EntityInsightItem]"},
+ "asn": {"key": "asn", "type": "int"},
+ "city": {"key": "city", "type": "str"},
+ "country_code": {"key": "countryCode", "type": "str"},
+ "country_name": {"key": "countryName", "type": "str"},
+ "latitude": {"key": "latitude", "type": "float"},
+ "longitude": {"key": "longitude", "type": "float"},
+ "state": {"key": "state", "type": "str"},
}
- def __init__(
- self,
- *,
- meta_data: Optional["_models.GetInsightsResultsMetadata"] = None,
- value: Optional[List["_models.EntityInsightItem"]] = None,
- **kwargs
- ):
- """
- :keyword meta_data: The metadata from the get insights operation results.
- :paramtype meta_data: ~azure.mgmt.securityinsight.models.GetInsightsResultsMetadata
- :keyword value: The insights result values.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityInsightItem]
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.meta_data = meta_data
- self.value = value
+ self.asn = None
+ self.city = None
+ self.country_code = None
+ self.country_name = None
+ self.latitude = None
+ self.longitude = None
+ self.state = None
+
+class GitHubAuthModel(CcpAuthConfig):
+ """Model for API authentication for GitHub. For this authentication first we need to approve the
+ Router app (Microsoft Security DevOps) to access the GitHub account, Then we only need the
+ InstallationId to get the access token from
+ https://api.github.com/app/installations/{installId}/access_tokens.
-class EntityInsightItem(_serialization.Model):
- """Entity insight Item.
+ All required parameters must be populated in order to send to server.
- :ivar query_id: The query id of the insight.
- :vartype query_id: str
- :ivar query_time_interval: The Time interval that the query actually executed on.
- :vartype query_time_interval:
- ~azure.mgmt.securityinsight.models.EntityInsightItemQueryTimeInterval
- :ivar table_query_results: Query results for table insights query.
- :vartype table_query_results: ~azure.mgmt.securityinsight.models.InsightsTableResult
- :ivar chart_query_results: Query results for table insights query.
- :vartype chart_query_results: list[~azure.mgmt.securityinsight.models.InsightsTableResult]
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar installation_id: The GitHubApp auth installation id.
+ :vartype installation_id: str
"""
+ _validation = {
+ "type": {"required": True},
+ }
+
_attribute_map = {
- "query_id": {"key": "queryId", "type": "str"},
- "query_time_interval": {"key": "queryTimeInterval", "type": "EntityInsightItemQueryTimeInterval"},
- "table_query_results": {"key": "tableQueryResults", "type": "InsightsTableResult"},
- "chart_query_results": {"key": "chartQueryResults", "type": "[InsightsTableResult]"},
+ "type": {"key": "type", "type": "str"},
+ "installation_id": {"key": "installationId", "type": "str"},
}
- def __init__(
- self,
- *,
- query_id: Optional[str] = None,
- query_time_interval: Optional["_models.EntityInsightItemQueryTimeInterval"] = None,
- table_query_results: Optional["_models.InsightsTableResult"] = None,
- chart_query_results: Optional[List["_models.InsightsTableResult"]] = None,
- **kwargs
- ):
- """
- :keyword query_id: The query id of the insight.
- :paramtype query_id: str
- :keyword query_time_interval: The Time interval that the query actually executed on.
- :paramtype query_time_interval:
- ~azure.mgmt.securityinsight.models.EntityInsightItemQueryTimeInterval
- :keyword table_query_results: Query results for table insights query.
- :paramtype table_query_results: ~azure.mgmt.securityinsight.models.InsightsTableResult
- :keyword chart_query_results: Query results for table insights query.
- :paramtype chart_query_results: list[~azure.mgmt.securityinsight.models.InsightsTableResult]
+ def __init__(self, *, installation_id: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword installation_id: The GitHubApp auth installation id.
+ :paramtype installation_id: str
"""
super().__init__(**kwargs)
- self.query_id = query_id
- self.query_time_interval = query_time_interval
- self.table_query_results = table_query_results
- self.chart_query_results = chart_query_results
+ self.type: str = "GitHub"
+ self.installation_id = installation_id
-class EntityInsightItemQueryTimeInterval(_serialization.Model):
- """The Time interval that the query actually executed on.
+class GitHubResourceInfo(_serialization.Model):
+ """Resources created in GitHub repository.
- :ivar start_time: Insight query start time.
- :vartype start_time: ~datetime.datetime
- :ivar end_time: Insight query end time.
- :vartype end_time: ~datetime.datetime
+ :ivar app_installation_id: GitHub application installation id.
+ :vartype app_installation_id: str
"""
_attribute_map = {
- "start_time": {"key": "startTime", "type": "iso-8601"},
- "end_time": {"key": "endTime", "type": "iso-8601"},
+ "app_installation_id": {"key": "appInstallationId", "type": "str"},
}
- def __init__(
- self, *, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, **kwargs
- ):
+ def __init__(self, *, app_installation_id: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword start_time: Insight query start time.
- :paramtype start_time: ~datetime.datetime
- :keyword end_time: Insight query end time.
- :paramtype end_time: ~datetime.datetime
+ :keyword app_installation_id: GitHub application installation id.
+ :paramtype app_installation_id: str
"""
super().__init__(**kwargs)
- self.start_time = start_time
- self.end_time = end_time
-
+ self.app_installation_id = app_installation_id
-class EntityList(_serialization.Model):
- """List of all the entities.
- Variables are only populated by the server, and will be ignored when sending a request.
+class GraphQuery(_serialization.Model):
+ """The graph query to show the volume of data arriving into the workspace over time.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar next_link: URL to fetch the next set of entities.
- :vartype next_link: str
- :ivar value: Array of entities. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Entity]
+ :ivar metric_name: Gets or sets the metric name that the query is checking. For example: 'Total
+ data receive'. Required.
+ :vartype metric_name: str
+ :ivar legend: Gets or sets the legend for the graph. Required.
+ :vartype legend: str
+ :ivar base_query: Gets or sets the base query for the graph.
+ The base query is wrapped by Sentinel UI infra with a KQL query, that measures the volume over
+ time. Required.
+ :vartype base_query: str
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ "metric_name": {"required": True},
+ "legend": {"required": True},
+ "base_query": {"required": True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Entity]"},
+ "metric_name": {"key": "metricName", "type": "str"},
+ "legend": {"key": "legend", "type": "str"},
+ "base_query": {"key": "baseQuery", "type": "str"},
}
- def __init__(self, *, value: List["_models.Entity"], **kwargs):
+ def __init__(self, *, metric_name: str, legend: str, base_query: str, **kwargs: Any) -> None:
"""
- :keyword value: Array of entities. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Entity]
+ :keyword metric_name: Gets or sets the metric name that the query is checking. For example:
+ 'Total data receive'. Required.
+ :paramtype metric_name: str
+ :keyword legend: Gets or sets the legend for the graph. Required.
+ :paramtype legend: str
+ :keyword base_query: Gets or sets the base query for the graph.
+ The base query is wrapped by Sentinel UI infra with a KQL query, that measures the volume over
+ time. Required.
+ :paramtype base_query: str
"""
super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ self.metric_name = metric_name
+ self.legend = legend
+ self.base_query = base_query
-class EntityMapping(_serialization.Model):
- """Single entity mapping for the alert rule.
+class GroupingConfiguration(_serialization.Model):
+ """Grouping configuration property bag.
- :ivar entity_type: The V3 type of the mapped entity. Known values are: "Account", "Host", "IP",
- "Malware", "File", "Process", "CloudApplication", "DNS", "AzureResource", "FileHash",
- "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "Mailbox", "MailCluster",
- "MailMessage", and "SubmissionMail".
- :vartype entity_type: str or ~azure.mgmt.securityinsight.models.EntityMappingType
- :ivar field_mappings: array of field mappings for the given entity mapping.
- :vartype field_mappings: list[~azure.mgmt.securityinsight.models.FieldMapping]
+ All required parameters must be populated in order to send to server.
+
+ :ivar enabled: Grouping enabled. Required.
+ :vartype enabled: bool
+ :ivar reopen_closed_incident: Re-open closed matching incidents. Required.
+ :vartype reopen_closed_incident: bool
+ :ivar lookback_duration: Limit the group to alerts created within the lookback duration (in ISO
+ 8601 duration format). Required.
+ :vartype lookback_duration: ~datetime.timedelta
+ :ivar matching_method: Grouping matching method. When method is Selected at least one of
+ groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty.
+ Required. Known values are: "AllEntities", "AnyAlert", and "Selected".
+ :vartype matching_method: str or ~azure.mgmt.securityinsight.models.MatchingMethod
+ :ivar group_by_entities: A list of entity types to group by (when matchingMethod is Selected).
+ Only entities defined in the current alert rule may be used.
+ :vartype group_by_entities: list[str or ~azure.mgmt.securityinsight.models.EntityMappingType]
+ :ivar group_by_alert_details: A list of alert details to group by (when matchingMethod is
+ Selected).
+ :vartype group_by_alert_details: list[str or ~azure.mgmt.securityinsight.models.AlertDetail]
+ :ivar group_by_custom_details: A list of custom details keys to group by (when matchingMethod
+ is Selected). Only keys defined in the current alert rule may be used.
+ :vartype group_by_custom_details: list[str]
"""
+ _validation = {
+ "enabled": {"required": True},
+ "reopen_closed_incident": {"required": True},
+ "lookback_duration": {"required": True},
+ "matching_method": {"required": True},
+ }
+
_attribute_map = {
- "entity_type": {"key": "entityType", "type": "str"},
- "field_mappings": {"key": "fieldMappings", "type": "[FieldMapping]"},
+ "enabled": {"key": "enabled", "type": "bool"},
+ "reopen_closed_incident": {"key": "reopenClosedIncident", "type": "bool"},
+ "lookback_duration": {"key": "lookbackDuration", "type": "duration"},
+ "matching_method": {"key": "matchingMethod", "type": "str"},
+ "group_by_entities": {"key": "groupByEntities", "type": "[str]"},
+ "group_by_alert_details": {"key": "groupByAlertDetails", "type": "[str]"},
+ "group_by_custom_details": {"key": "groupByCustomDetails", "type": "[str]"},
}
def __init__(
self,
*,
- entity_type: Optional[Union[str, "_models.EntityMappingType"]] = None,
- field_mappings: Optional[List["_models.FieldMapping"]] = None,
- **kwargs
- ):
+ enabled: bool,
+ reopen_closed_incident: bool,
+ lookback_duration: datetime.timedelta,
+ matching_method: Union[str, "_models.MatchingMethod"],
+ group_by_entities: Optional[List[Union[str, "_models.EntityMappingType"]]] = None,
+ group_by_alert_details: Optional[List[Union[str, "_models.AlertDetail"]]] = None,
+ group_by_custom_details: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword entity_type: The V3 type of the mapped entity. Known values are: "Account", "Host",
- "IP", "Malware", "File", "Process", "CloudApplication", "DNS", "AzureResource", "FileHash",
- "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "Mailbox", "MailCluster",
- "MailMessage", and "SubmissionMail".
- :paramtype entity_type: str or ~azure.mgmt.securityinsight.models.EntityMappingType
- :keyword field_mappings: array of field mappings for the given entity mapping.
- :paramtype field_mappings: list[~azure.mgmt.securityinsight.models.FieldMapping]
+ :keyword enabled: Grouping enabled. Required.
+ :paramtype enabled: bool
+ :keyword reopen_closed_incident: Re-open closed matching incidents. Required.
+ :paramtype reopen_closed_incident: bool
+ :keyword lookback_duration: Limit the group to alerts created within the lookback duration (in
+ ISO 8601 duration format). Required.
+ :paramtype lookback_duration: ~datetime.timedelta
+ :keyword matching_method: Grouping matching method. When method is Selected at least one of
+ groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty.
+ Required. Known values are: "AllEntities", "AnyAlert", and "Selected".
+ :paramtype matching_method: str or ~azure.mgmt.securityinsight.models.MatchingMethod
+ :keyword group_by_entities: A list of entity types to group by (when matchingMethod is
+ Selected). Only entities defined in the current alert rule may be used.
+ :paramtype group_by_entities: list[str or ~azure.mgmt.securityinsight.models.EntityMappingType]
+ :keyword group_by_alert_details: A list of alert details to group by (when matchingMethod is
+ Selected).
+ :paramtype group_by_alert_details: list[str or ~azure.mgmt.securityinsight.models.AlertDetail]
+ :keyword group_by_custom_details: A list of custom details keys to group by (when
+ matchingMethod is Selected). Only keys defined in the current alert rule may be used.
+ :paramtype group_by_custom_details: list[str]
"""
super().__init__(**kwargs)
- self.entity_type = entity_type
- self.field_mappings = field_mappings
-
+ self.enabled = enabled
+ self.reopen_closed_incident = reopen_closed_incident
+ self.lookback_duration = lookback_duration
+ self.matching_method = matching_method
+ self.group_by_entities = group_by_entities
+ self.group_by_alert_details = group_by_alert_details
+ self.group_by_custom_details = group_by_custom_details
-class EntityQueryItem(_serialization.Model):
- """An abstract Query item for entity.
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- InsightQueryItem
+class HostEntity(Entity):
+ """Represents a host entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Query Template ARM ID.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
- :ivar name: Query Template ARM Name.
+ :ivar name: The name of the resource.
:vartype name: str
- :ivar type: ARM Type.
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
:vartype type: str
- :ivar kind: The kind of the entity query. Required. Known values are: "Expansion", "Insight",
- and "Activity".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryKind
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar azure_id: The azure resource id of the VM.
+ :vartype azure_id: str
+ :ivar dns_domain: The DNS domain that this host belongs to. Should contain the compete DNS
+ suffix for the domain.
+ :vartype dns_domain: str
+ :ivar host_name: The hostname without the domain suffix.
+ :vartype host_name: str
+ :ivar is_domain_joined: Determines whether this host belongs to a domain.
+ :vartype is_domain_joined: bool
+ :ivar net_bios_name: The host name (pre-windows2000).
+ :vartype net_bios_name: str
+ :ivar nt_domain: The NT domain that this host belongs to.
+ :vartype nt_domain: str
+ :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed.
+ :vartype oms_agent_id: str
+ :ivar os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
+ "IOS", and "Unknown".
+ :vartype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
+ :ivar os_version: A free text representation of the operating system. This field is meant to
+ hold specific versions the are more fine grained than OSFamily or future values not supported
+ by OSFamily enumeration.
+ :vartype os_version: str
"""
_validation = {
"id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
"kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "azure_id": {"readonly": True},
+ "dns_domain": {"readonly": True},
+ "host_name": {"readonly": True},
+ "is_domain_joined": {"readonly": True},
+ "net_bios_name": {"readonly": True},
+ "nt_domain": {"readonly": True},
+ "oms_agent_id": {"readonly": True},
+ "os_version": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
"kind": {"key": "kind", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "azure_id": {"key": "properties.azureID", "type": "str"},
+ "dns_domain": {"key": "properties.dnsDomain", "type": "str"},
+ "host_name": {"key": "properties.hostName", "type": "str"},
+ "is_domain_joined": {"key": "properties.isDomainJoined", "type": "bool"},
+ "net_bios_name": {"key": "properties.netBiosName", "type": "str"},
+ "nt_domain": {"key": "properties.ntDomain", "type": "str"},
+ "oms_agent_id": {"key": "properties.omsAgentID", "type": "str"},
+ "os_family": {"key": "properties.osFamily", "type": "str"},
+ "os_version": {"key": "properties.osVersion", "type": "str"},
}
- _subtype_map = {"kind": {"Insight": "InsightQueryItem"}}
-
- def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs):
+ def __init__(self, *, os_family: Optional[Union[str, "_models.OSFamily"]] = None, **kwargs: Any) -> None:
"""
- :keyword name: Query Template ARM Name.
- :paramtype name: str
- :keyword type: ARM Type.
- :paramtype type: str
+ :keyword os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
+ "IOS", and "Unknown".
+ :paramtype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
"""
super().__init__(**kwargs)
- self.id = None
- self.name = name
- self.type = type
- self.kind: Optional[str] = None
+ self.kind: str = "Host"
+ self.additional_data = None
+ self.friendly_name = None
+ self.azure_id = None
+ self.dns_domain = None
+ self.host_name = None
+ self.is_domain_joined = None
+ self.net_bios_name = None
+ self.nt_domain = None
+ self.oms_agent_id = None
+ self.os_family = os_family
+ self.os_version = None
-class EntityQueryItemProperties(_serialization.Model):
- """An properties abstract Query item for entity.
+class HostEntityProperties(EntityCommonProperties):
+ """Host entity property bag.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar data_types: Data types for template.
- :vartype data_types:
- list[~azure.mgmt.securityinsight.models.EntityQueryItemPropertiesDataTypesItem]
- :ivar input_entity_type: The type of the entity. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice", "SecurityAlert",
- "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :ivar required_input_fields_sets: Data types for template.
- :vartype required_input_fields_sets: list[list[str]]
- :ivar entities_filter: The query applied only to entities matching to all filters.
- :vartype entities_filter: JSON
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar azure_id: The azure resource id of the VM.
+ :vartype azure_id: str
+ :ivar dns_domain: The DNS domain that this host belongs to. Should contain the compete DNS
+ suffix for the domain.
+ :vartype dns_domain: str
+ :ivar host_name: The hostname without the domain suffix.
+ :vartype host_name: str
+ :ivar is_domain_joined: Determines whether this host belongs to a domain.
+ :vartype is_domain_joined: bool
+ :ivar net_bios_name: The host name (pre-windows2000).
+ :vartype net_bios_name: str
+ :ivar nt_domain: The NT domain that this host belongs to.
+ :vartype nt_domain: str
+ :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed.
+ :vartype oms_agent_id: str
+ :ivar os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
+ "IOS", and "Unknown".
+ :vartype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
+ :ivar os_version: A free text representation of the operating system. This field is meant to
+ hold specific versions the are more fine grained than OSFamily or future values not supported
+ by OSFamily enumeration.
+ :vartype os_version: str
"""
+ _validation = {
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "azure_id": {"readonly": True},
+ "dns_domain": {"readonly": True},
+ "host_name": {"readonly": True},
+ "is_domain_joined": {"readonly": True},
+ "net_bios_name": {"readonly": True},
+ "nt_domain": {"readonly": True},
+ "oms_agent_id": {"readonly": True},
+ "os_version": {"readonly": True},
+ }
+
_attribute_map = {
- "data_types": {"key": "dataTypes", "type": "[EntityQueryItemPropertiesDataTypesItem]"},
- "input_entity_type": {"key": "inputEntityType", "type": "str"},
- "required_input_fields_sets": {"key": "requiredInputFieldsSets", "type": "[[str]]"},
- "entities_filter": {"key": "entitiesFilter", "type": "object"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "azure_id": {"key": "azureID", "type": "str"},
+ "dns_domain": {"key": "dnsDomain", "type": "str"},
+ "host_name": {"key": "hostName", "type": "str"},
+ "is_domain_joined": {"key": "isDomainJoined", "type": "bool"},
+ "net_bios_name": {"key": "netBiosName", "type": "str"},
+ "nt_domain": {"key": "ntDomain", "type": "str"},
+ "oms_agent_id": {"key": "omsAgentID", "type": "str"},
+ "os_family": {"key": "osFamily", "type": "str"},
+ "os_version": {"key": "osVersion", "type": "str"},
}
- def __init__(
- self,
- *,
- data_types: Optional[List["_models.EntityQueryItemPropertiesDataTypesItem"]] = None,
- input_entity_type: Optional[Union[str, "_models.EntityType"]] = None,
- required_input_fields_sets: Optional[List[List[str]]] = None,
- entities_filter: Optional[JSON] = None,
- **kwargs
- ):
- """
- :keyword data_types: Data types for template.
- :paramtype data_types:
- list[~azure.mgmt.securityinsight.models.EntityQueryItemPropertiesDataTypesItem]
- :keyword input_entity_type: The type of the entity. Known values are: "Account", "Host",
- "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice", "SecurityAlert",
- "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :paramtype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :keyword required_input_fields_sets: Data types for template.
- :paramtype required_input_fields_sets: list[list[str]]
- :keyword entities_filter: The query applied only to entities matching to all filters.
- :paramtype entities_filter: JSON
+ def __init__(self, *, os_family: Optional[Union[str, "_models.OSFamily"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
+ "IOS", and "Unknown".
+ :paramtype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
"""
super().__init__(**kwargs)
- self.data_types = data_types
- self.input_entity_type = input_entity_type
- self.required_input_fields_sets = required_input_fields_sets
- self.entities_filter = entities_filter
+ self.azure_id = None
+ self.dns_domain = None
+ self.host_name = None
+ self.is_domain_joined = None
+ self.net_bios_name = None
+ self.nt_domain = None
+ self.oms_agent_id = None
+ self.os_family = os_family
+ self.os_version = None
-class EntityQueryItemPropertiesDataTypesItem(_serialization.Model):
- """EntityQueryItemPropertiesDataTypesItem.
+class HuntingBookmark(Entity):
+ """Represents a Hunting bookmark entity.
- :ivar data_type: Data type name.
- :vartype data_type: str
- """
+ Variables are only populated by the server, and will be ignored when sending a request.
- _attribute_map = {
- "data_type": {"key": "dataType", "type": "str"},
- }
-
- def __init__(self, *, data_type: Optional[str] = None, **kwargs):
- """
- :keyword data_type: Data type name.
- :paramtype data_type: str
- """
- super().__init__(**kwargs)
- self.data_type = data_type
-
-
-class EntityQueryList(_serialization.Model):
- """List of all the entity queries.
-
- 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 next_link: URL to fetch the next set of entity queries.
- :vartype next_link: str
- :ivar value: Array of entity queries. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.EntityQuery]
- """
-
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[EntityQuery]"},
- }
-
- def __init__(self, *, value: List["_models.EntityQuery"], **kwargs):
- """
- :keyword value: Array of entity queries. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQuery]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class EntityQueryTemplateList(_serialization.Model):
- """List of all the entity query templates.
-
- 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 next_link: URL to fetch the next set of entity query templates.
- :vartype next_link: str
- :ivar value: Array of entity query templates. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
- """
-
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[EntityQueryTemplate]"},
- }
-
- def __init__(self, *, value: List["_models.EntityQueryTemplate"], **kwargs):
- """
- :keyword value: Array of entity query templates. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class EntityTimelineParameters(_serialization.Model):
- """The parameters required to execute s timeline operation on the given entity.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kinds: Array of timeline Item kinds.
- :vartype kinds: list[str or ~azure.mgmt.securityinsight.models.EntityTimelineKind]
- :ivar start_time: The start timeline date, so the results returned are after this date.
- Required.
- :vartype start_time: ~datetime.datetime
- :ivar end_time: The end timeline date, so the results returned are before this date. Required.
- :vartype end_time: ~datetime.datetime
- :ivar number_of_bucket: The number of bucket for timeline queries aggregation.
- :vartype number_of_bucket: int
- """
-
- _validation = {
- "start_time": {"required": True},
- "end_time": {"required": True},
- }
-
- _attribute_map = {
- "kinds": {"key": "kinds", "type": "[str]"},
- "start_time": {"key": "startTime", "type": "iso-8601"},
- "end_time": {"key": "endTime", "type": "iso-8601"},
- "number_of_bucket": {"key": "numberOfBucket", "type": "int"},
- }
-
- def __init__(
- self,
- *,
- start_time: datetime.datetime,
- end_time: datetime.datetime,
- kinds: Optional[List[Union[str, "_models.EntityTimelineKind"]]] = None,
- number_of_bucket: Optional[int] = None,
- **kwargs
- ):
- """
- :keyword kinds: Array of timeline Item kinds.
- :paramtype kinds: list[str or ~azure.mgmt.securityinsight.models.EntityTimelineKind]
- :keyword start_time: The start timeline date, so the results returned are after this date.
- Required.
- :paramtype start_time: ~datetime.datetime
- :keyword end_time: The end timeline date, so the results returned are before this date.
- Required.
- :paramtype end_time: ~datetime.datetime
- :keyword number_of_bucket: The number of bucket for timeline queries aggregation.
- :paramtype number_of_bucket: int
- """
- super().__init__(**kwargs)
- self.kinds = kinds
- self.start_time = start_time
- self.end_time = end_time
- self.number_of_bucket = number_of_bucket
-
-
-class EntityTimelineResponse(_serialization.Model):
- """The entity timeline result operation response.
-
- :ivar meta_data: The metadata from the timeline operation results.
- :vartype meta_data: ~azure.mgmt.securityinsight.models.TimelineResultsMetadata
- :ivar value: The timeline result values.
- :vartype value: list[~azure.mgmt.securityinsight.models.EntityTimelineItem]
- """
-
- _attribute_map = {
- "meta_data": {"key": "metaData", "type": "TimelineResultsMetadata"},
- "value": {"key": "value", "type": "[EntityTimelineItem]"},
- }
-
- def __init__(
- self,
- *,
- meta_data: Optional["_models.TimelineResultsMetadata"] = None,
- value: Optional[List["_models.EntityTimelineItem"]] = None,
- **kwargs
- ):
- """
- :keyword meta_data: The metadata from the timeline operation results.
- :paramtype meta_data: ~azure.mgmt.securityinsight.models.TimelineResultsMetadata
- :keyword value: The timeline result values.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityTimelineItem]
- """
- super().__init__(**kwargs)
- self.meta_data = meta_data
- self.value = value
-
-
-class EventGroupingSettings(_serialization.Model):
- """Event grouping settings property bag.
-
- :ivar aggregation_kind: The event grouping aggregation kinds. Known values are: "SingleAlert"
- and "AlertPerResult".
- :vartype aggregation_kind: str or
- ~azure.mgmt.securityinsight.models.EventGroupingAggregationKind
- """
-
- _attribute_map = {
- "aggregation_kind": {"key": "aggregationKind", "type": "str"},
- }
-
- def __init__(
- self, *, aggregation_kind: Optional[Union[str, "_models.EventGroupingAggregationKind"]] = None, **kwargs
- ):
- """
- :keyword aggregation_kind: The event grouping aggregation kinds. Known values are:
- "SingleAlert" and "AlertPerResult".
- :paramtype aggregation_kind: str or
- ~azure.mgmt.securityinsight.models.EventGroupingAggregationKind
- """
- super().__init__(**kwargs)
- self.aggregation_kind = aggregation_kind
-
-
-class ExpansionEntityQuery(EntityQuery): # pylint: disable=too-many-instance-attributes
- """Represents Expansion entity query.
+ All required parameters must be populated in order to send to server.
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -8041,27 +5425,39 @@ class ExpansionEntityQuery(EntityQuery): # pylint: disable=too-many-instance-at
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: the entity query kind. Required. Known values are: "Expansion", "Insight", and
- "Activity".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryKind
- :ivar data_sources: List of the data sources that are required to run the query.
- :vartype data_sources: list[str]
- :ivar display_name: The query display name.
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar created: The time the bookmark was created.
+ :vartype created: ~datetime.datetime
+ :ivar created_by: Describes a user that created the bookmark.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar display_name: The display name of the bookmark.
:vartype display_name: str
- :ivar input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :vartype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :ivar input_fields: List of the fields of the source entity that are required to run the query.
- :vartype input_fields: list[str]
- :ivar output_entity_types: List of the desired output types to be constructed from the result.
- :vartype output_entity_types: list[str or ~azure.mgmt.securityinsight.models.EntityType]
- :ivar query_template: The template query string to be parsed and formatted.
- :vartype query_template: str
+ :ivar event_time: The time of the event.
+ :vartype event_time: ~datetime.datetime
+ :ivar labels: List of labels relevant to this bookmark.
+ :vartype labels: list[str]
+ :ivar notes: The notes of the bookmark.
+ :vartype notes: str
+ :ivar query: The query of the bookmark.
+ :vartype query: str
+ :ivar query_result: The query result of the bookmark.
+ :vartype query_result: str
+ :ivar updated: The last time the bookmark was updated.
+ :vartype updated: ~datetime.datetime
+ :ivar updated_by: Describes a user that updated the bookmark.
+ :vartype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar incident_info: Describes an incident that relates to bookmark.
+ :vartype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
"""
_validation = {
@@ -8070,6 +5466,8 @@ class ExpansionEntityQuery(EntityQuery): # pylint: disable=too-many-instance-at
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
}
_attribute_map = {
@@ -8077,152 +5475,200 @@ class ExpansionEntityQuery(EntityQuery): # pylint: disable=too-many-instance-at
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "data_sources": {"key": "properties.dataSources", "type": "[str]"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "created": {"key": "properties.created", "type": "iso-8601"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
"display_name": {"key": "properties.displayName", "type": "str"},
- "input_entity_type": {"key": "properties.inputEntityType", "type": "str"},
- "input_fields": {"key": "properties.inputFields", "type": "[str]"},
- "output_entity_types": {"key": "properties.outputEntityTypes", "type": "[str]"},
- "query_template": {"key": "properties.queryTemplate", "type": "str"},
+ "event_time": {"key": "properties.eventTime", "type": "iso-8601"},
+ "labels": {"key": "properties.labels", "type": "[str]"},
+ "notes": {"key": "properties.notes", "type": "str"},
+ "query": {"key": "properties.query", "type": "str"},
+ "query_result": {"key": "properties.queryResult", "type": "str"},
+ "updated": {"key": "properties.updated", "type": "iso-8601"},
+ "updated_by": {"key": "properties.updatedBy", "type": "UserInfo"},
+ "incident_info": {"key": "properties.incidentInfo", "type": "IncidentInfo"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- data_sources: Optional[List[str]] = None,
+ created: Optional[datetime.datetime] = None,
+ created_by: Optional["_models.UserInfo"] = None,
display_name: Optional[str] = None,
- input_entity_type: Optional[Union[str, "_models.EntityType"]] = None,
- input_fields: Optional[List[str]] = None,
- output_entity_types: Optional[List[Union[str, "_models.EntityType"]]] = None,
- query_template: Optional[str] = None,
- **kwargs
- ):
+ event_time: Optional[datetime.datetime] = None,
+ labels: Optional[List[str]] = None,
+ notes: Optional[str] = None,
+ query: Optional[str] = None,
+ query_result: Optional[str] = None,
+ updated: Optional[datetime.datetime] = None,
+ updated_by: Optional["_models.UserInfo"] = None,
+ incident_info: Optional["_models.IncidentInfo"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword data_sources: List of the data sources that are required to run the query.
- :paramtype data_sources: list[str]
- :keyword display_name: The query display name.
+ :keyword created: The time the bookmark was created.
+ :paramtype created: ~datetime.datetime
+ :keyword created_by: Describes a user that created the bookmark.
+ :paramtype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :keyword display_name: The display name of the bookmark.
:paramtype display_name: str
- :keyword input_entity_type: The type of the query's source entity. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware",
- "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice",
- "SecurityAlert", "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail",
- and "Nic".
- :paramtype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :keyword input_fields: List of the fields of the source entity that are required to run the
- query.
- :paramtype input_fields: list[str]
- :keyword output_entity_types: List of the desired output types to be constructed from the
- result.
- :paramtype output_entity_types: list[str or ~azure.mgmt.securityinsight.models.EntityType]
- :keyword query_template: The template query string to be parsed and formatted.
- :paramtype query_template: str
+ :keyword event_time: The time of the event.
+ :paramtype event_time: ~datetime.datetime
+ :keyword labels: List of labels relevant to this bookmark.
+ :paramtype labels: list[str]
+ :keyword notes: The notes of the bookmark.
+ :paramtype notes: str
+ :keyword query: The query of the bookmark.
+ :paramtype query: str
+ :keyword query_result: The query result of the bookmark.
+ :paramtype query_result: str
+ :keyword updated: The last time the bookmark was updated.
+ :paramtype updated: ~datetime.datetime
+ :keyword updated_by: Describes a user that updated the bookmark.
+ :paramtype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :keyword incident_info: Describes an incident that relates to bookmark.
+ :paramtype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Expansion"
- self.data_sources = data_sources
+ super().__init__(**kwargs)
+ self.kind: str = "Bookmark"
+ self.additional_data = None
+ self.friendly_name = None
+ self.created = created
+ self.created_by = created_by
self.display_name = display_name
- self.input_entity_type = input_entity_type
- self.input_fields = input_fields
- self.output_entity_types = output_entity_types
- self.query_template = query_template
+ self.event_time = event_time
+ self.labels = labels
+ self.notes = notes
+ self.query = query
+ self.query_result = query_result
+ self.updated = updated
+ self.updated_by = updated_by
+ self.incident_info = incident_info
+
+class HuntingBookmarkProperties(EntityCommonProperties):
+ """Describes bookmark properties.
-class ExpansionResultAggregation(_serialization.Model):
- """Information of a specific aggregation in the expansion result.
+ 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.
+ All required parameters must be populated in order to send to server.
- :ivar aggregation_type: The common type of the aggregation. (for e.g. entity field name).
- :vartype aggregation_type: str
- :ivar count: Total number of aggregations of the given kind (and aggregationType if given) in
- the expansion result. Required.
- :vartype count: int
- :ivar display_name: The display name of the aggregation by type.
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar created: The time the bookmark was created.
+ :vartype created: ~datetime.datetime
+ :ivar created_by: Describes a user that created the bookmark.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar display_name: The display name of the bookmark. Required.
:vartype display_name: str
- :ivar entity_kind: The kind of the aggregated entity. Required. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip",
- "Malware", "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice",
- "SecurityAlert", "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and
- "Nic".
- :vartype entity_kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ :ivar event_time: The time of the event.
+ :vartype event_time: ~datetime.datetime
+ :ivar labels: List of labels relevant to this bookmark.
+ :vartype labels: list[str]
+ :ivar notes: The notes of the bookmark.
+ :vartype notes: str
+ :ivar query: The query of the bookmark. Required.
+ :vartype query: str
+ :ivar query_result: The query result of the bookmark.
+ :vartype query_result: str
+ :ivar updated: The last time the bookmark was updated.
+ :vartype updated: ~datetime.datetime
+ :ivar updated_by: Describes a user that updated the bookmark.
+ :vartype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar incident_info: Describes an incident that relates to bookmark.
+ :vartype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
"""
_validation = {
- "count": {"required": True},
- "entity_kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "display_name": {"required": True},
+ "query": {"required": True},
}
_attribute_map = {
- "aggregation_type": {"key": "aggregationType", "type": "str"},
- "count": {"key": "count", "type": "int"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "created": {"key": "created", "type": "iso-8601"},
+ "created_by": {"key": "createdBy", "type": "UserInfo"},
"display_name": {"key": "displayName", "type": "str"},
- "entity_kind": {"key": "entityKind", "type": "str"},
+ "event_time": {"key": "eventTime", "type": "iso-8601"},
+ "labels": {"key": "labels", "type": "[str]"},
+ "notes": {"key": "notes", "type": "str"},
+ "query": {"key": "query", "type": "str"},
+ "query_result": {"key": "queryResult", "type": "str"},
+ "updated": {"key": "updated", "type": "iso-8601"},
+ "updated_by": {"key": "updatedBy", "type": "UserInfo"},
+ "incident_info": {"key": "incidentInfo", "type": "IncidentInfo"},
}
def __init__(
self,
*,
- count: int,
- entity_kind: Union[str, "_models.EntityKind"],
- aggregation_type: Optional[str] = None,
- display_name: Optional[str] = None,
- **kwargs
- ):
+ display_name: str,
+ query: str,
+ created: Optional[datetime.datetime] = None,
+ created_by: Optional["_models.UserInfo"] = None,
+ event_time: Optional[datetime.datetime] = None,
+ labels: Optional[List[str]] = None,
+ notes: Optional[str] = None,
+ query_result: Optional[str] = None,
+ updated: Optional[datetime.datetime] = None,
+ updated_by: Optional["_models.UserInfo"] = None,
+ incident_info: Optional["_models.IncidentInfo"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword aggregation_type: The common type of the aggregation. (for e.g. entity field name).
- :paramtype aggregation_type: str
- :keyword count: Total number of aggregations of the given kind (and aggregationType if given)
- in the expansion result. Required.
- :paramtype count: int
- :keyword display_name: The display name of the aggregation by type.
+ :keyword created: The time the bookmark was created.
+ :paramtype created: ~datetime.datetime
+ :keyword created_by: Describes a user that created the bookmark.
+ :paramtype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :keyword display_name: The display name of the bookmark. Required.
:paramtype display_name: str
- :keyword entity_kind: The kind of the aggregated entity. Required. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip",
- "Malware", "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice",
- "SecurityAlert", "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and
- "Nic".
- :paramtype entity_kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ :keyword event_time: The time of the event.
+ :paramtype event_time: ~datetime.datetime
+ :keyword labels: List of labels relevant to this bookmark.
+ :paramtype labels: list[str]
+ :keyword notes: The notes of the bookmark.
+ :paramtype notes: str
+ :keyword query: The query of the bookmark. Required.
+ :paramtype query: str
+ :keyword query_result: The query result of the bookmark.
+ :paramtype query_result: str
+ :keyword updated: The last time the bookmark was updated.
+ :paramtype updated: ~datetime.datetime
+ :keyword updated_by: Describes a user that updated the bookmark.
+ :paramtype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :keyword incident_info: Describes an incident that relates to bookmark.
+ :paramtype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
"""
super().__init__(**kwargs)
- self.aggregation_type = aggregation_type
- self.count = count
+ self.created = created
+ self.created_by = created_by
self.display_name = display_name
- self.entity_kind = entity_kind
-
-
-class ExpansionResultsMetadata(_serialization.Model):
- """Expansion result metadata.
-
- :ivar aggregations: Information of the aggregated nodes in the expansion result.
- :vartype aggregations: list[~azure.mgmt.securityinsight.models.ExpansionResultAggregation]
- """
-
- _attribute_map = {
- "aggregations": {"key": "aggregations", "type": "[ExpansionResultAggregation]"},
- }
-
- def __init__(self, *, aggregations: Optional[List["_models.ExpansionResultAggregation"]] = None, **kwargs):
- """
- :keyword aggregations: Information of the aggregated nodes in the expansion result.
- :paramtype aggregations: list[~azure.mgmt.securityinsight.models.ExpansionResultAggregation]
- """
- super().__init__(**kwargs)
- self.aggregations = aggregations
+ self.event_time = event_time
+ self.labels = labels
+ self.notes = notes
+ self.query = query
+ self.query_result = query_result
+ self.updated = updated
+ self.updated_by = updated_by
+ self.incident_info = incident_info
-class EyesOn(Settings):
- """Settings with single toggle.
+class Incident(ResourceWithEtag):
+ """Represents an incident in Azure Security Insights.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -8234,11 +5680,50 @@ class EyesOn(Settings):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the setting. Required. Known values are: "Anomalies", "EyesOn",
- "EntityAnalytics", and "Ueba".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SettingKind
- :ivar is_enabled: Determines whether the setting is enable or disabled.
- :vartype is_enabled: bool
+ :ivar additional_data: Additional data on the incident.
+ :vartype additional_data: ~azure.mgmt.securityinsight.models.IncidentAdditionalData
+ :ivar classification: The reason the incident was closed. Known values are: "Undetermined",
+ "TruePositive", "BenignPositive", and "FalsePositive".
+ :vartype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
+ :ivar classification_comment: Describes the reason the incident was closed.
+ :vartype classification_comment: str
+ :ivar classification_reason: The classification reason the incident was closed with. Known
+ values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
+ "InaccurateData".
+ :vartype classification_reason: str or
+ ~azure.mgmt.securityinsight.models.IncidentClassificationReason
+ :ivar created_time_utc: The time the incident was created.
+ :vartype created_time_utc: ~datetime.datetime
+ :ivar description: The description of the incident.
+ :vartype description: str
+ :ivar first_activity_time_utc: The time of the first activity in the incident.
+ :vartype first_activity_time_utc: ~datetime.datetime
+ :ivar incident_url: The deep-link url to the incident in Azure portal.
+ :vartype incident_url: str
+ :ivar provider_name: The name of the source provider that generated the incident.
+ :vartype provider_name: str
+ :ivar provider_incident_id: The incident ID assigned by the incident provider.
+ :vartype provider_incident_id: str
+ :ivar incident_number: A sequential number.
+ :vartype incident_number: int
+ :ivar labels: List of labels relevant to this incident.
+ :vartype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
+ :ivar last_activity_time_utc: The time of the last activity in the incident.
+ :vartype last_activity_time_utc: ~datetime.datetime
+ :ivar last_modified_time_utc: The last time the incident was updated.
+ :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar owner: Describes a user that the incident is assigned to.
+ :vartype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
+ :ivar related_analytic_rule_ids: List of resource ids of Analytic rules related to the
+ incident.
+ :vartype related_analytic_rule_ids: list[str]
+ :ivar severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
+ "Informational".
+ :vartype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
+ :ivar status: The status of the incident. Known values are: "New", "Active", and "Closed".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
+ :ivar title: The title of the incident.
+ :vartype title: str
"""
_validation = {
@@ -8246,8 +5731,14 @@ class EyesOn(Settings):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
- "is_enabled": {"readonly": True},
+ "additional_data": {"readonly": True},
+ "created_time_utc": {"readonly": True},
+ "incident_url": {"readonly": True},
+ "provider_name": {"readonly": True},
+ "provider_incident_id": {"readonly": True},
+ "incident_number": {"readonly": True},
+ "last_modified_time_utc": {"readonly": True},
+ "related_analytic_rule_ids": {"readonly": True},
}
_attribute_map = {
@@ -8256,182 +5747,205 @@ class EyesOn(Settings):
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "is_enabled": {"key": "properties.isEnabled", "type": "bool"},
+ "additional_data": {"key": "properties.additionalData", "type": "IncidentAdditionalData"},
+ "classification": {"key": "properties.classification", "type": "str"},
+ "classification_comment": {"key": "properties.classificationComment", "type": "str"},
+ "classification_reason": {"key": "properties.classificationReason", "type": "str"},
+ "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
+ "description": {"key": "properties.description", "type": "str"},
+ "first_activity_time_utc": {"key": "properties.firstActivityTimeUtc", "type": "iso-8601"},
+ "incident_url": {"key": "properties.incidentUrl", "type": "str"},
+ "provider_name": {"key": "properties.providerName", "type": "str"},
+ "provider_incident_id": {"key": "properties.providerIncidentId", "type": "str"},
+ "incident_number": {"key": "properties.incidentNumber", "type": "int"},
+ "labels": {"key": "properties.labels", "type": "[IncidentLabel]"},
+ "last_activity_time_utc": {"key": "properties.lastActivityTimeUtc", "type": "iso-8601"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "owner": {"key": "properties.owner", "type": "IncidentOwnerInfo"},
+ "related_analytic_rule_ids": {"key": "properties.relatedAnalyticRuleIds", "type": "[str]"},
+ "severity": {"key": "properties.severity", "type": "str"},
+ "status": {"key": "properties.status", "type": "str"},
+ "title": {"key": "properties.title", "type": "str"},
}
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ etag: Optional[str] = None,
+ classification: Optional[Union[str, "_models.IncidentClassification"]] = None,
+ classification_comment: Optional[str] = None,
+ classification_reason: Optional[Union[str, "_models.IncidentClassificationReason"]] = None,
+ description: Optional[str] = None,
+ first_activity_time_utc: Optional[datetime.datetime] = None,
+ labels: Optional[List["_models.IncidentLabel"]] = None,
+ last_activity_time_utc: Optional[datetime.datetime] = None,
+ owner: Optional["_models.IncidentOwnerInfo"] = None,
+ severity: Optional[Union[str, "_models.IncidentSeverity"]] = None,
+ status: Optional[Union[str, "_models.IncidentStatus"]] = None,
+ title: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
+ :keyword classification: The reason the incident was closed. Known values are: "Undetermined",
+ "TruePositive", "BenignPositive", and "FalsePositive".
+ :paramtype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
+ :keyword classification_comment: Describes the reason the incident was closed.
+ :paramtype classification_comment: str
+ :keyword classification_reason: The classification reason the incident was closed with. Known
+ values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
+ "InaccurateData".
+ :paramtype classification_reason: str or
+ ~azure.mgmt.securityinsight.models.IncidentClassificationReason
+ :keyword description: The description of the incident.
+ :paramtype description: str
+ :keyword first_activity_time_utc: The time of the first activity in the incident.
+ :paramtype first_activity_time_utc: ~datetime.datetime
+ :keyword labels: List of labels relevant to this incident.
+ :paramtype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
+ :keyword last_activity_time_utc: The time of the last activity in the incident.
+ :paramtype last_activity_time_utc: ~datetime.datetime
+ :keyword owner: Describes a user that the incident is assigned to.
+ :paramtype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
+ :keyword severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
+ "Informational".
+ :paramtype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
+ :keyword status: The status of the incident. Known values are: "New", "Active", and "Closed".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
+ :keyword title: The title of the incident.
+ :paramtype title: str
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "EyesOn"
- self.is_enabled = None
+ self.additional_data = None
+ self.classification = classification
+ self.classification_comment = classification_comment
+ self.classification_reason = classification_reason
+ self.created_time_utc = None
+ self.description = description
+ self.first_activity_time_utc = first_activity_time_utc
+ self.incident_url = None
+ self.provider_name = None
+ self.provider_incident_id = None
+ self.incident_number = None
+ self.labels = labels
+ self.last_activity_time_utc = last_activity_time_utc
+ self.last_modified_time_utc = None
+ self.owner = owner
+ self.related_analytic_rule_ids = None
+ self.severity = severity
+ self.status = status
+ self.title = title
-class FieldMapping(_serialization.Model):
- """A single field mapping of the mapped entity.
+class IncidentAdditionalData(_serialization.Model):
+ """Incident additional data property bag.
- :ivar identifier: the V3 identifier of the entity.
- :vartype identifier: str
- :ivar column_name: the column name to be mapped to the identifier.
- :vartype column_name: str
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar alerts_count: The number of alerts in the incident.
+ :vartype alerts_count: int
+ :ivar bookmarks_count: The number of bookmarks in the incident.
+ :vartype bookmarks_count: int
+ :ivar comments_count: The number of comments in the incident.
+ :vartype comments_count: int
+ :ivar alert_product_names: List of product names of alerts in the incident.
+ :vartype alert_product_names: list[str]
+ :ivar tactics: The tactics associated with incident.
+ :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :ivar provider_incident_url: The provider incident url to the incident in Microsoft 365
+ Defender portal.
+ :vartype provider_incident_url: str
"""
+ _validation = {
+ "alerts_count": {"readonly": True},
+ "bookmarks_count": {"readonly": True},
+ "comments_count": {"readonly": True},
+ "alert_product_names": {"readonly": True},
+ "tactics": {"readonly": True},
+ "provider_incident_url": {"readonly": True},
+ }
+
_attribute_map = {
- "identifier": {"key": "identifier", "type": "str"},
- "column_name": {"key": "columnName", "type": "str"},
+ "alerts_count": {"key": "alertsCount", "type": "int"},
+ "bookmarks_count": {"key": "bookmarksCount", "type": "int"},
+ "comments_count": {"key": "commentsCount", "type": "int"},
+ "alert_product_names": {"key": "alertProductNames", "type": "[str]"},
+ "tactics": {"key": "tactics", "type": "[str]"},
+ "provider_incident_url": {"key": "providerIncidentUrl", "type": "str"},
}
- def __init__(self, *, identifier: Optional[str] = None, column_name: Optional[str] = None, **kwargs):
- """
- :keyword identifier: the V3 identifier of the entity.
- :paramtype identifier: str
- :keyword column_name: the column name to be mapped to the identifier.
- :paramtype column_name: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.identifier = identifier
- self.column_name = column_name
-
+ self.alerts_count = None
+ self.bookmarks_count = None
+ self.comments_count = None
+ self.alert_product_names = None
+ self.tactics = None
+ self.provider_incident_url = None
-class FileEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a file entity.
- Variables are only populated by the server, and will be ignored when sending a request.
+class IncidentAlertList(_serialization.Model):
+ """List of incident alerts.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar directory: The full path to the file.
- :vartype directory: str
- :ivar file_hash_entity_ids: The file hash entity identifiers associated with this file.
- :vartype file_hash_entity_ids: list[str]
- :ivar file_name: The file name without path (some alerts might not include path).
- :vartype file_name: str
- :ivar host_entity_id: The Host entity id which the file belongs to.
- :vartype host_entity_id: str
+ :ivar value: Array of incident alerts. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "directory": {"readonly": True},
- "file_hash_entity_ids": {"readonly": True},
- "file_name": {"readonly": True},
- "host_entity_id": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "directory": {"key": "properties.directory", "type": "str"},
- "file_hash_entity_ids": {"key": "properties.fileHashEntityIds", "type": "[str]"},
- "file_name": {"key": "properties.fileName", "type": "str"},
- "host_entity_id": {"key": "properties.hostEntityId", "type": "str"},
+ "value": {"key": "value", "type": "[SecurityAlert]"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, value: List["_models.SecurityAlert"], **kwargs: Any) -> None:
+ """
+ :keyword value: Array of incident alerts. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
+ """
super().__init__(**kwargs)
- self.kind: str = "File"
- self.additional_data = None
- self.friendly_name = None
- self.directory = None
- self.file_hash_entity_ids = None
- self.file_name = None
- self.host_entity_id = None
+ self.value = value
-class FileEntityProperties(EntityCommonProperties):
- """File entity property bag.
+class IncidentBookmarkList(_serialization.Model):
+ """List of incident bookmarks.
- 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 server.
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar directory: The full path to the file.
- :vartype directory: str
- :ivar file_hash_entity_ids: The file hash entity identifiers associated with this file.
- :vartype file_hash_entity_ids: list[str]
- :ivar file_name: The file name without path (some alerts might not include path).
- :vartype file_name: str
- :ivar host_entity_id: The Host entity id which the file belongs to.
- :vartype host_entity_id: str
+ :ivar value: Array of incident bookmarks. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.HuntingBookmark]
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "directory": {"readonly": True},
- "file_hash_entity_ids": {"readonly": True},
- "file_name": {"readonly": True},
- "host_entity_id": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "directory": {"key": "directory", "type": "str"},
- "file_hash_entity_ids": {"key": "fileHashEntityIds", "type": "[str]"},
- "file_name": {"key": "fileName", "type": "str"},
- "host_entity_id": {"key": "hostEntityId", "type": "str"},
+ "value": {"key": "value", "type": "[HuntingBookmark]"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, value: List["_models.HuntingBookmark"], **kwargs: Any) -> None:
+ """
+ :keyword value: Array of incident bookmarks. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.HuntingBookmark]
+ """
super().__init__(**kwargs)
- self.directory = None
- self.file_hash_entity_ids = None
- self.file_name = None
- self.host_entity_id = None
+ self.value = value
-class FileHashEntity(Entity):
- """Represents a file hash entity.
+class IncidentComment(ResourceWithEtag):
+ """Represents an incident comment.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -8441,22 +5955,16 @@ class FileHashEntity(Entity):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar algorithm: The hash algorithm type. Known values are: "Unknown", "MD5", "SHA1", "SHA256",
- and "SHA256AC".
- :vartype algorithm: str or ~azure.mgmt.securityinsight.models.FileHashAlgorithm
- :ivar hash_value: The file hash value.
- :vartype hash_value: str
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar created_time_utc: The time the comment was created.
+ :vartype created_time_utc: ~datetime.datetime
+ :ivar last_modified_time_utc: The time the comment was updated.
+ :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar message: The comment message.
+ :vartype message: str
+ :ivar author: Describes the client that created the comment.
+ :vartype author: ~azure.mgmt.securityinsight.models.ClientInfo
"""
_validation = {
@@ -8464,11 +5972,9 @@ class FileHashEntity(Entity):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "algorithm": {"readonly": True},
- "hash_value": {"readonly": True},
+ "created_time_utc": {"readonly": True},
+ "last_modified_time_utc": {"readonly": True},
+ "author": {"readonly": True},
}
_attribute_map = {
@@ -8476,1156 +5982,1115 @@ class FileHashEntity(Entity):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "algorithm": {"key": "properties.algorithm", "type": "str"},
- "hash_value": {"key": "properties.hashValue", "type": "str"},
+ "etag": {"key": "etag", "type": "str"},
+ "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "message": {"key": "properties.message", "type": "str"},
+ "author": {"key": "properties.author", "type": "ClientInfo"},
}
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "FileHash"
- self.additional_data = None
- self.friendly_name = None
- self.algorithm = None
- self.hash_value = None
+ def __init__(self, *, etag: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword message: The comment message.
+ :paramtype message: str
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.created_time_utc = None
+ self.last_modified_time_utc = None
+ self.message = message
+ self.author = None
-class FileHashEntityProperties(EntityCommonProperties):
- """FileHash entity property bag.
+class IncidentCommentList(_serialization.Model):
+ """List of incident comments.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar algorithm: The hash algorithm type. Known values are: "Unknown", "MD5", "SHA1", "SHA256",
- and "SHA256AC".
- :vartype algorithm: str or ~azure.mgmt.securityinsight.models.FileHashAlgorithm
- :ivar hash_value: The file hash value.
- :vartype hash_value: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar next_link: URL to fetch the next set of comments.
+ :vartype next_link: str
+ :ivar value: Array of comments. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "algorithm": {"readonly": True},
- "hash_value": {"readonly": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "algorithm": {"key": "algorithm", "type": "str"},
- "hash_value": {"key": "hashValue", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[IncidentComment]"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, value: List["_models.IncidentComment"], **kwargs: Any) -> None:
+ """
+ :keyword value: Array of comments. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
+ """
super().__init__(**kwargs)
- self.algorithm = None
- self.hash_value = None
+ self.next_link = None
+ self.value = value
-class FileImport(Resource): # pylint: disable=too-many-instance-attributes
- """Represents a file import in Azure Security Insights.
+class IncidentConfiguration(_serialization.Model):
+ """Incident Configuration property bag.
- 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 server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar ingestion_mode: Describes how to ingest the records in the file. Known values are:
- "IngestOnlyIfAllAreValid", "IngestAnyValidRecords", and "Unspecified".
- :vartype ingestion_mode: str or ~azure.mgmt.securityinsight.models.IngestionMode
- :ivar content_type: The content type of this file. Known values are: "BasicIndicator",
- "StixIndicator", and "Unspecified".
- :vartype content_type: str or ~azure.mgmt.securityinsight.models.FileImportContentType
- :ivar created_time_utc: The time the file was imported.
- :vartype created_time_utc: ~datetime.datetime
- :ivar error_file: Represents the error file (if the import was ingested with errors or failed
- the validation).
- :vartype error_file: ~azure.mgmt.securityinsight.models.FileMetadata
- :ivar errors_preview: An ordered list of some of the errors that were encountered during
- validation.
- :vartype errors_preview: list[~azure.mgmt.securityinsight.models.ValidationError]
- :ivar import_file: Represents the imported file.
- :vartype import_file: ~azure.mgmt.securityinsight.models.FileMetadata
- :ivar ingested_record_count: The number of records that have been successfully ingested.
- :vartype ingested_record_count: int
- :ivar source: The source for the data in the file.
- :vartype source: str
- :ivar state: The state of the file import. Known values are: "FatalError", "Ingested",
- "IngestedWithErrors", "InProgress", "Invalid", "WaitingForUpload", and "Unspecified".
- :vartype state: str or ~azure.mgmt.securityinsight.models.FileImportState
- :ivar total_record_count: The number of records in the file.
- :vartype total_record_count: int
- :ivar valid_record_count: The number of records that have passed validation.
- :vartype valid_record_count: int
- :ivar files_valid_until_time_utc: The time the files associated with this import are deleted
- from the storage account.
- :vartype files_valid_until_time_utc: ~datetime.datetime
- :ivar import_valid_until_time_utc: The time the file import record is soft deleted from the
- database and history.
- :vartype import_valid_until_time_utc: ~datetime.datetime
+ :ivar create_incident: Create incidents from alerts triggered by this analytics rule. Required.
+ :vartype create_incident: bool
+ :ivar grouping_configuration: Set how the alerts that are triggered by this analytics rule, are
+ grouped into incidents.
+ :vartype grouping_configuration: ~azure.mgmt.securityinsight.models.GroupingConfiguration
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "created_time_utc": {"readonly": True},
- "error_file": {"readonly": True},
- "errors_preview": {"readonly": True},
- "ingested_record_count": {"readonly": True},
- "state": {"readonly": True},
- "total_record_count": {"readonly": True},
- "valid_record_count": {"readonly": True},
- "files_valid_until_time_utc": {"readonly": True},
- "import_valid_until_time_utc": {"readonly": True},
+ "create_incident": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "ingestion_mode": {"key": "properties.ingestionMode", "type": "str"},
- "content_type": {"key": "properties.contentType", "type": "str"},
- "created_time_utc": {"key": "properties.createdTimeUTC", "type": "iso-8601"},
- "error_file": {"key": "properties.errorFile", "type": "FileMetadata"},
- "errors_preview": {"key": "properties.errorsPreview", "type": "[ValidationError]"},
- "import_file": {"key": "properties.importFile", "type": "FileMetadata"},
- "ingested_record_count": {"key": "properties.ingestedRecordCount", "type": "int"},
- "source": {"key": "properties.source", "type": "str"},
- "state": {"key": "properties.state", "type": "str"},
- "total_record_count": {"key": "properties.totalRecordCount", "type": "int"},
- "valid_record_count": {"key": "properties.validRecordCount", "type": "int"},
- "files_valid_until_time_utc": {"key": "properties.filesValidUntilTimeUTC", "type": "iso-8601"},
- "import_valid_until_time_utc": {"key": "properties.importValidUntilTimeUTC", "type": "iso-8601"},
- }
+ "create_incident": {"key": "createIncident", "type": "bool"},
+ "grouping_configuration": {"key": "groupingConfiguration", "type": "GroupingConfiguration"},
+ }
def __init__(
self,
*,
- ingestion_mode: Optional[Union[str, "_models.IngestionMode"]] = None,
- content_type: Optional[Union[str, "_models.FileImportContentType"]] = None,
- import_file: Optional["_models.FileMetadata"] = None,
- source: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword ingestion_mode: Describes how to ingest the records in the file. Known values are:
- "IngestOnlyIfAllAreValid", "IngestAnyValidRecords", and "Unspecified".
- :paramtype ingestion_mode: str or ~azure.mgmt.securityinsight.models.IngestionMode
- :keyword content_type: The content type of this file. Known values are: "BasicIndicator",
- "StixIndicator", and "Unspecified".
- :paramtype content_type: str or ~azure.mgmt.securityinsight.models.FileImportContentType
- :keyword import_file: Represents the imported file.
- :paramtype import_file: ~azure.mgmt.securityinsight.models.FileMetadata
- :keyword source: The source for the data in the file.
- :paramtype source: str
+ create_incident: bool,
+ grouping_configuration: Optional["_models.GroupingConfiguration"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword create_incident: Create incidents from alerts triggered by this analytics rule.
+ Required.
+ :paramtype create_incident: bool
+ :keyword grouping_configuration: Set how the alerts that are triggered by this analytics rule,
+ are grouped into incidents.
+ :paramtype grouping_configuration: ~azure.mgmt.securityinsight.models.GroupingConfiguration
"""
super().__init__(**kwargs)
- self.ingestion_mode = ingestion_mode
- self.content_type = content_type
- self.created_time_utc = None
- self.error_file = None
- self.errors_preview = None
- self.import_file = import_file
- self.ingested_record_count = None
- self.source = source
- self.state = None
- self.total_record_count = None
- self.valid_record_count = None
- self.files_valid_until_time_utc = None
- self.import_valid_until_time_utc = None
+ self.create_incident = create_incident
+ self.grouping_configuration = grouping_configuration
-class FileImportList(_serialization.Model):
- """List all the file imports.
+class IncidentEntitiesResponse(_serialization.Model):
+ """The incident related entities response.
- Variables are only populated by the server, and will be ignored when sending a request.
+ :ivar entities: Array of the incident related entities.
+ :vartype entities: list[~azure.mgmt.securityinsight.models.Entity]
+ :ivar meta_data: The metadata from the incident related entities results.
+ :vartype meta_data: list[~azure.mgmt.securityinsight.models.IncidentEntitiesResultsMetadata]
+ """
+
+ _attribute_map = {
+ "entities": {"key": "entities", "type": "[Entity]"},
+ "meta_data": {"key": "metaData", "type": "[IncidentEntitiesResultsMetadata]"},
+ }
- All required parameters must be populated in order to send to Azure.
+ def __init__(
+ self,
+ *,
+ entities: Optional[List["_models.Entity"]] = None,
+ meta_data: Optional[List["_models.IncidentEntitiesResultsMetadata"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword entities: Array of the incident related entities.
+ :paramtype entities: list[~azure.mgmt.securityinsight.models.Entity]
+ :keyword meta_data: The metadata from the incident related entities results.
+ :paramtype meta_data: list[~azure.mgmt.securityinsight.models.IncidentEntitiesResultsMetadata]
+ """
+ super().__init__(**kwargs)
+ self.entities = entities
+ self.meta_data = meta_data
- :ivar next_link: URL to fetch the next set of file imports.
- :vartype next_link: str
- :ivar value: Array of file imports. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.FileImport]
+
+class IncidentEntitiesResultsMetadata(_serialization.Model):
+ """Information of a specific aggregation in the incident related entities result.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar count: Total number of aggregations of the given kind in the incident related entities
+ result. Required.
+ :vartype count: int
+ :ivar entity_kind: The kind of the aggregated entity. Required. Known values are: "Account",
+ "Host", "File", "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip",
+ "Malware", "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice",
+ "SecurityAlert", "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype entity_kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ "count": {"required": True},
+ "entity_kind": {"required": True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[FileImport]"},
+ "count": {"key": "count", "type": "int"},
+ "entity_kind": {"key": "entityKind", "type": "str"},
}
- def __init__(self, *, value: List["_models.FileImport"], **kwargs):
+ def __init__(self, *, count: int, entity_kind: Union[str, "_models.EntityKindEnum"], **kwargs: Any) -> None:
"""
- :keyword value: Array of file imports. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.FileImport]
+ :keyword count: Total number of aggregations of the given kind in the incident related entities
+ result. Required.
+ :paramtype count: int
+ :keyword entity_kind: The kind of the aggregated entity. Required. Known values are: "Account",
+ "Host", "File", "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip",
+ "Malware", "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice",
+ "SecurityAlert", "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :paramtype entity_kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
"""
super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
+ self.count = count
+ self.entity_kind = entity_kind
-class FileMetadata(_serialization.Model):
- """Represents a file.
- Variables are only populated by the server, and will be ignored when sending a request.
+class IncidentInfo(_serialization.Model):
+ """Describes related incident information for the bookmark.
- :ivar file_format: The format of the file. Known values are: "CSV", "JSON", and "Unspecified".
- :vartype file_format: str or ~azure.mgmt.securityinsight.models.FileFormat
- :ivar file_name: The name of the file.
- :vartype file_name: str
- :ivar file_size: The size of the file.
- :vartype file_size: int
- :ivar file_content_uri: A URI with a valid SAS token to allow uploading / downloading the file.
- :vartype file_content_uri: str
- :ivar delete_status: Indicates whether the file was deleted from the storage account. Known
- values are: "Deleted", "NotDeleted", and "Unspecified".
- :vartype delete_status: str or ~azure.mgmt.securityinsight.models.DeleteStatus
+ :ivar incident_id: Incident Id.
+ :vartype incident_id: str
+ :ivar severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
+ "Informational".
+ :vartype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
+ :ivar title: The title of the incident.
+ :vartype title: str
+ :ivar relation_name: Relation Name.
+ :vartype relation_name: str
"""
- _validation = {
- "file_content_uri": {"readonly": True},
- "delete_status": {"readonly": True},
- }
-
_attribute_map = {
- "file_format": {"key": "fileFormat", "type": "str"},
- "file_name": {"key": "fileName", "type": "str"},
- "file_size": {"key": "fileSize", "type": "int"},
- "file_content_uri": {"key": "fileContentUri", "type": "str"},
- "delete_status": {"key": "deleteStatus", "type": "str"},
+ "incident_id": {"key": "incidentId", "type": "str"},
+ "severity": {"key": "severity", "type": "str"},
+ "title": {"key": "title", "type": "str"},
+ "relation_name": {"key": "relationName", "type": "str"},
}
def __init__(
self,
*,
- file_format: Optional[Union[str, "_models.FileFormat"]] = None,
- file_name: Optional[str] = None,
- file_size: Optional[int] = None,
- **kwargs
- ):
- """
- :keyword file_format: The format of the file. Known values are: "CSV", "JSON", and
- "Unspecified".
- :paramtype file_format: str or ~azure.mgmt.securityinsight.models.FileFormat
- :keyword file_name: The name of the file.
- :paramtype file_name: str
- :keyword file_size: The size of the file.
- :paramtype file_size: int
+ incident_id: Optional[str] = None,
+ severity: Optional[Union[str, "_models.IncidentSeverity"]] = None,
+ title: Optional[str] = None,
+ relation_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword incident_id: Incident Id.
+ :paramtype incident_id: str
+ :keyword severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
+ "Informational".
+ :paramtype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
+ :keyword title: The title of the incident.
+ :paramtype title: str
+ :keyword relation_name: Relation Name.
+ :paramtype relation_name: str
"""
super().__init__(**kwargs)
- self.file_format = file_format
- self.file_name = file_name
- self.file_size = file_size
- self.file_content_uri = None
- self.delete_status = None
+ self.incident_id = incident_id
+ self.severity = severity
+ self.title = title
+ self.relation_name = relation_name
-class FusionAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents Fusion alert rule.
+class IncidentLabel(_serialization.Model):
+ """Represents an incident label.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
- :vartype alert_rule_template_name: str
- :ivar description: The description of the alert rule.
- :vartype description: str
- :ivar display_name: The display name for alerts created by this alert rule.
- :vartype display_name: str
- :ivar enabled: Determines whether this alert rule is enabled or disabled.
- :vartype enabled: bool
- :ivar source_settings: Configuration for all supported source signals in fusion detection.
- :vartype source_settings: list[~azure.mgmt.securityinsight.models.FusionSourceSettings]
- :ivar scenario_exclusion_patterns: Configuration to exclude scenarios in fusion detection.
- :vartype scenario_exclusion_patterns:
- list[~azure.mgmt.securityinsight.models.FusionScenarioExclusionPattern]
- :ivar last_modified_utc: The last time that this alert has been modified.
- :vartype last_modified_utc: ~datetime.datetime
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
+ :ivar label_name: The name of the label. Required.
+ :vartype label_name: str
+ :ivar label_type: The type of the label. Known values are: "User" and "AutoAssigned".
+ :vartype label_type: str or ~azure.mgmt.securityinsight.models.IncidentLabelType
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "description": {"readonly": True},
- "display_name": {"readonly": True},
- "last_modified_utc": {"readonly": True},
- "severity": {"readonly": True},
- "tactics": {"readonly": True},
- "techniques": {"readonly": True},
+ "label_name": {"required": True},
+ "label_type": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "source_settings": {"key": "properties.sourceSettings", "type": "[FusionSourceSettings]"},
- "scenario_exclusion_patterns": {
- "key": "properties.scenarioExclusionPatterns",
- "type": "[FusionScenarioExclusionPattern]",
- },
- "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
- "severity": {"key": "properties.severity", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
+ "label_name": {"key": "labelName", "type": "str"},
+ "label_type": {"key": "labelType", "type": "str"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- alert_rule_template_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- source_settings: Optional[List["_models.FusionSourceSettings"]] = None,
- scenario_exclusion_patterns: Optional[List["_models.FusionScenarioExclusionPattern"]] = None,
- **kwargs
- ):
+ def __init__(self, *, label_name: str, **kwargs: Any) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword alert_rule_template_name: The Name of the alert rule template used to create this
- rule.
- :paramtype alert_rule_template_name: str
- :keyword enabled: Determines whether this alert rule is enabled or disabled.
- :paramtype enabled: bool
- :keyword source_settings: Configuration for all supported source signals in fusion detection.
- :paramtype source_settings: list[~azure.mgmt.securityinsight.models.FusionSourceSettings]
- :keyword scenario_exclusion_patterns: Configuration to exclude scenarios in fusion detection.
- :paramtype scenario_exclusion_patterns:
- list[~azure.mgmt.securityinsight.models.FusionScenarioExclusionPattern]
+ :keyword label_name: The name of the label. Required.
+ :paramtype label_name: str
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Fusion"
- self.alert_rule_template_name = alert_rule_template_name
- self.description = None
- self.display_name = None
- self.enabled = enabled
- self.source_settings = source_settings
- self.scenario_exclusion_patterns = scenario_exclusion_patterns
- self.last_modified_utc = None
- self.severity = None
- self.tactics = None
- self.techniques = None
+ super().__init__(**kwargs)
+ self.label_name = label_name
+ self.label_type = None
-class FusionAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents Fusion alert rule template.
+class IncidentList(_serialization.Model):
+ """List all the incidents.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar last_updated_date_utc: The time that this alert rule template was last updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data connectors for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar tactics: The tactics of the alert rule template.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
- :ivar source_settings: All supported source signal configurations consumed in fusion detection.
- :vartype source_settings: list[~azure.mgmt.securityinsight.models.FusionTemplateSourceSetting]
+ :ivar next_link: URL to fetch the next set of incidents.
+ :vartype next_link: str
+ :ivar value: Array of incidents. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Incident]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "created_date_utc": {"readonly": True},
- "last_updated_date_utc": {"readonly": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
- "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
- "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "required_data_connectors": {
- "key": "properties.requiredDataConnectors",
- "type": "[AlertRuleTemplateDataSource]",
- },
- "status": {"key": "properties.status", "type": "str"},
- "severity": {"key": "properties.severity", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
- "source_settings": {"key": "properties.sourceSettings", "type": "[FusionTemplateSourceSetting]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Incident]"},
}
- def __init__(
- self,
- *,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- source_settings: Optional[List["_models.FusionTemplateSourceSetting"]] = None,
- **kwargs
- ):
+ def __init__(self, *, value: List["_models.Incident"], **kwargs: Any) -> None:
"""
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data connectors for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword tactics: The tactics of the alert rule template.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- :keyword source_settings: All supported source signal configurations consumed in fusion
- detection.
- :paramtype source_settings:
- list[~azure.mgmt.securityinsight.models.FusionTemplateSourceSetting]
+ :keyword value: Array of incidents. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Incident]
"""
super().__init__(**kwargs)
- self.kind: str = "Fusion"
- self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.created_date_utc = None
- self.last_updated_date_utc = None
- self.description = description
- self.display_name = display_name
- self.required_data_connectors = required_data_connectors
- self.status = status
- self.severity = severity
- self.tactics = tactics
- self.techniques = techniques
- self.source_settings = source_settings
-
+ self.next_link = None
+ self.value = value
-class FusionScenarioExclusionPattern(_serialization.Model):
- """Represents a Fusion scenario exclusion patterns in Fusion detection.
- All required parameters must be populated in order to send to Azure.
+class IncidentOwnerInfo(_serialization.Model):
+ """Information on the user an incident is assigned to.
- :ivar exclusion_pattern: Scenario exclusion pattern. Required.
- :vartype exclusion_pattern: str
- :ivar date_added_in_utc: DateTime when scenario exclusion pattern is added in UTC. Required.
- :vartype date_added_in_utc: str
+ :ivar email: The email of the user the incident is assigned to.
+ :vartype email: str
+ :ivar assigned_to: The name of the user the incident is assigned to.
+ :vartype assigned_to: str
+ :ivar object_id: The object id of the user the incident is assigned to.
+ :vartype object_id: str
+ :ivar user_principal_name: The user principal name of the user the incident is assigned to.
+ :vartype user_principal_name: str
+ :ivar owner_type: The type of the owner the incident is assigned to. Known values are:
+ "Unknown", "User", and "Group".
+ :vartype owner_type: str or ~azure.mgmt.securityinsight.models.OwnerType
"""
- _validation = {
- "exclusion_pattern": {"required": True},
- "date_added_in_utc": {"required": True},
- }
-
_attribute_map = {
- "exclusion_pattern": {"key": "exclusionPattern", "type": "str"},
- "date_added_in_utc": {"key": "dateAddedInUTC", "type": "str"},
+ "email": {"key": "email", "type": "str"},
+ "assigned_to": {"key": "assignedTo", "type": "str"},
+ "object_id": {"key": "objectId", "type": "str"},
+ "user_principal_name": {"key": "userPrincipalName", "type": "str"},
+ "owner_type": {"key": "ownerType", "type": "str"},
}
- def __init__(self, *, exclusion_pattern: str, date_added_in_utc: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ email: Optional[str] = None,
+ assigned_to: Optional[str] = None,
+ object_id: Optional[str] = None,
+ user_principal_name: Optional[str] = None,
+ owner_type: Optional[Union[str, "_models.OwnerType"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword exclusion_pattern: Scenario exclusion pattern. Required.
- :paramtype exclusion_pattern: str
- :keyword date_added_in_utc: DateTime when scenario exclusion pattern is added in UTC. Required.
- :paramtype date_added_in_utc: str
+ :keyword email: The email of the user the incident is assigned to.
+ :paramtype email: str
+ :keyword assigned_to: The name of the user the incident is assigned to.
+ :paramtype assigned_to: str
+ :keyword object_id: The object id of the user the incident is assigned to.
+ :paramtype object_id: str
+ :keyword user_principal_name: The user principal name of the user the incident is assigned to.
+ :paramtype user_principal_name: str
+ :keyword owner_type: The type of the owner the incident is assigned to. Known values are:
+ "Unknown", "User", and "Group".
+ :paramtype owner_type: str or ~azure.mgmt.securityinsight.models.OwnerType
"""
super().__init__(**kwargs)
- self.exclusion_pattern = exclusion_pattern
- self.date_added_in_utc = date_added_in_utc
-
+ self.email = email
+ self.assigned_to = assigned_to
+ self.object_id = object_id
+ self.user_principal_name = user_principal_name
+ self.owner_type = owner_type
-class FusionSourceSettings(_serialization.Model):
- """Represents a supported source signal configuration in Fusion detection.
- All required parameters must be populated in order to send to Azure.
+class IncidentPropertiesAction(_serialization.Model):
+ """IncidentPropertiesAction.
- :ivar enabled: Determines whether this source signal is enabled or disabled in Fusion
- detection. Required.
- :vartype enabled: bool
- :ivar source_name: Name of the Fusion source signal. Refer to Fusion alert rule template for
- supported values. Required.
- :vartype source_name: str
- :ivar source_sub_types: Configuration for all source subtypes under this source signal consumed
- in fusion detection.
- :vartype source_sub_types: list[~azure.mgmt.securityinsight.models.FusionSourceSubTypeSetting]
+ :ivar severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
+ "Informational".
+ :vartype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
+ :ivar status: The status of the incident. Known values are: "New", "Active", and "Closed".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
+ :ivar classification: The reason the incident was closed. Known values are: "Undetermined",
+ "TruePositive", "BenignPositive", and "FalsePositive".
+ :vartype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
+ :ivar classification_reason: The classification reason the incident was closed with. Known
+ values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
+ "InaccurateData".
+ :vartype classification_reason: str or
+ ~azure.mgmt.securityinsight.models.IncidentClassificationReason
+ :ivar classification_comment: Describes the reason the incident was closed.
+ :vartype classification_comment: str
+ :ivar owner: Information on the user an incident is assigned to.
+ :vartype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
+ :ivar labels: List of labels to add to the incident.
+ :vartype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
"""
- _validation = {
- "enabled": {"required": True},
- "source_name": {"required": True},
- }
-
_attribute_map = {
- "enabled": {"key": "enabled", "type": "bool"},
- "source_name": {"key": "sourceName", "type": "str"},
- "source_sub_types": {"key": "sourceSubTypes", "type": "[FusionSourceSubTypeSetting]"},
+ "severity": {"key": "severity", "type": "str"},
+ "status": {"key": "status", "type": "str"},
+ "classification": {"key": "classification", "type": "str"},
+ "classification_reason": {"key": "classificationReason", "type": "str"},
+ "classification_comment": {"key": "classificationComment", "type": "str"},
+ "owner": {"key": "owner", "type": "IncidentOwnerInfo"},
+ "labels": {"key": "labels", "type": "[IncidentLabel]"},
}
def __init__(
self,
*,
- enabled: bool,
- source_name: str,
- source_sub_types: Optional[List["_models.FusionSourceSubTypeSetting"]] = None,
- **kwargs
- ):
+ severity: Optional[Union[str, "_models.IncidentSeverity"]] = None,
+ status: Optional[Union[str, "_models.IncidentStatus"]] = None,
+ classification: Optional[Union[str, "_models.IncidentClassification"]] = None,
+ classification_reason: Optional[Union[str, "_models.IncidentClassificationReason"]] = None,
+ classification_comment: Optional[str] = None,
+ owner: Optional["_models.IncidentOwnerInfo"] = None,
+ labels: Optional[List["_models.IncidentLabel"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword enabled: Determines whether this source signal is enabled or disabled in Fusion
- detection. Required.
- :paramtype enabled: bool
- :keyword source_name: Name of the Fusion source signal. Refer to Fusion alert rule template for
- supported values. Required.
- :paramtype source_name: str
- :keyword source_sub_types: Configuration for all source subtypes under this source signal
- consumed in fusion detection.
- :paramtype source_sub_types:
- list[~azure.mgmt.securityinsight.models.FusionSourceSubTypeSetting]
+ :keyword severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
+ "Informational".
+ :paramtype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
+ :keyword status: The status of the incident. Known values are: "New", "Active", and "Closed".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
+ :keyword classification: The reason the incident was closed. Known values are: "Undetermined",
+ "TruePositive", "BenignPositive", and "FalsePositive".
+ :paramtype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
+ :keyword classification_reason: The classification reason the incident was closed with. Known
+ values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
+ "InaccurateData".
+ :paramtype classification_reason: str or
+ ~azure.mgmt.securityinsight.models.IncidentClassificationReason
+ :keyword classification_comment: Describes the reason the incident was closed.
+ :paramtype classification_comment: str
+ :keyword owner: Information on the user an incident is assigned to.
+ :paramtype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
+ :keyword labels: List of labels to add to the incident.
+ :paramtype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
"""
super().__init__(**kwargs)
- self.enabled = enabled
- self.source_name = source_name
- self.source_sub_types = source_sub_types
+ self.severity = severity
+ self.status = status
+ self.classification = classification
+ self.classification_reason = classification_reason
+ self.classification_comment = classification_comment
+ self.owner = owner
+ self.labels = labels
-class FusionSourceSubTypeSetting(_serialization.Model):
- """Represents a supported source subtype configuration under a source signal in Fusion detection.
+class IncidentTask(ResourceWithEtag):
+ """Describes incident task properties.
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.
+ All required parameters must be populated in order to send to server.
- :ivar enabled: Determines whether this source subtype under source signal is enabled or
- disabled in Fusion detection. Required.
- :vartype enabled: bool
- :ivar source_sub_type_name: The Name of the source subtype under a given source signal in
- Fusion detection. Refer to Fusion alert rule template for supported values. Required.
- :vartype source_sub_type_name: str
- :ivar source_sub_type_display_name: The display name of source subtype under a source signal
- consumed in Fusion detection.
- :vartype source_sub_type_display_name: str
- :ivar severity_filters: Severity configuration for a source subtype consumed in fusion
- detection. Required.
- :vartype severity_filters: ~azure.mgmt.securityinsight.models.FusionSubTypeSeverityFilter
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar title: The title of the task. Required.
+ :vartype title: str
+ :ivar description: The description of the task.
+ :vartype description: str
+ :ivar status: The status of the task. Required. Known values are: "New" and "Completed".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.IncidentTaskStatus
+ :ivar created_time_utc: The time the task was created.
+ :vartype created_time_utc: ~datetime.datetime
+ :ivar last_modified_time_utc: The last time the task was updated.
+ :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar created_by: Information on the client (user or application) that made some action.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.ClientInfo
+ :ivar last_modified_by: Information on the client (user or application) that made some action.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.ClientInfo
"""
_validation = {
- "enabled": {"required": True},
- "source_sub_type_name": {"required": True},
- "source_sub_type_display_name": {"readonly": True},
- "severity_filters": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "title": {"required": True},
+ "status": {"required": True},
+ "created_time_utc": {"readonly": True},
+ "last_modified_time_utc": {"readonly": True},
}
_attribute_map = {
- "enabled": {"key": "enabled", "type": "bool"},
- "source_sub_type_name": {"key": "sourceSubTypeName", "type": "str"},
- "source_sub_type_display_name": {"key": "sourceSubTypeDisplayName", "type": "str"},
- "severity_filters": {"key": "severityFilters", "type": "FusionSubTypeSeverityFilter"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "title": {"key": "properties.title", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "status": {"key": "properties.status", "type": "str"},
+ "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "created_by": {"key": "properties.createdBy", "type": "ClientInfo"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "ClientInfo"},
}
def __init__(
self,
*,
- enabled: bool,
- source_sub_type_name: str,
- severity_filters: "_models.FusionSubTypeSeverityFilter",
- **kwargs
- ):
+ title: str,
+ status: Union[str, "_models.IncidentTaskStatus"],
+ etag: Optional[str] = None,
+ description: Optional[str] = None,
+ created_by: Optional["_models.ClientInfo"] = None,
+ last_modified_by: Optional["_models.ClientInfo"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword enabled: Determines whether this source subtype under source signal is enabled or
- disabled in Fusion detection. Required.
- :paramtype enabled: bool
- :keyword source_sub_type_name: The Name of the source subtype under a given source signal in
- Fusion detection. Refer to Fusion alert rule template for supported values. Required.
- :paramtype source_sub_type_name: str
- :keyword severity_filters: Severity configuration for a source subtype consumed in fusion
- detection. Required.
- :paramtype severity_filters: ~azure.mgmt.securityinsight.models.FusionSubTypeSeverityFilter
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword title: The title of the task. Required.
+ :paramtype title: str
+ :keyword description: The description of the task.
+ :paramtype description: str
+ :keyword status: The status of the task. Required. Known values are: "New" and "Completed".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.IncidentTaskStatus
+ :keyword created_by: Information on the client (user or application) that made some action.
+ :paramtype created_by: ~azure.mgmt.securityinsight.models.ClientInfo
+ :keyword last_modified_by: Information on the client (user or application) that made some
+ action.
+ :paramtype last_modified_by: ~azure.mgmt.securityinsight.models.ClientInfo
"""
- super().__init__(**kwargs)
- self.enabled = enabled
- self.source_sub_type_name = source_sub_type_name
- self.source_sub_type_display_name = None
- self.severity_filters = severity_filters
-
+ super().__init__(etag=etag, **kwargs)
+ self.title = title
+ self.description = description
+ self.status = status
+ self.created_time_utc = None
+ self.last_modified_time_utc = None
+ self.created_by = created_by
+ self.last_modified_by = last_modified_by
-class FusionSubTypeSeverityFilter(_serialization.Model):
- """Represents severity configuration for a source subtype consumed in Fusion detection.
- Variables are only populated by the server, and will be ignored when sending a request.
+class IncidentTaskList(_serialization.Model):
+ """List of incident tasks.
- :ivar is_supported: Determines whether this source subtype supports severity configuration or
- not.
- :vartype is_supported: bool
- :ivar filters: Individual Severity configuration settings for a given source subtype consumed
- in Fusion detection.
- :vartype filters: list[~azure.mgmt.securityinsight.models.FusionSubTypeSeverityFiltersItem]
+ :ivar value:
+ :vartype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
+ :ivar next_link:
+ :vartype next_link: str
"""
- _validation = {
- "is_supported": {"readonly": True},
- }
-
_attribute_map = {
- "is_supported": {"key": "isSupported", "type": "bool"},
- "filters": {"key": "filters", "type": "[FusionSubTypeSeverityFiltersItem]"},
+ "value": {"key": "value", "type": "[IncidentTask]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, filters: Optional[List["_models.FusionSubTypeSeverityFiltersItem"]] = None, **kwargs):
+ def __init__(
+ self, *, value: Optional[List["_models.IncidentTask"]] = None, next_link: Optional[str] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword filters: Individual Severity configuration settings for a given source subtype
- consumed in Fusion detection.
- :paramtype filters: list[~azure.mgmt.securityinsight.models.FusionSubTypeSeverityFiltersItem]
+ :keyword value:
+ :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
+ :keyword next_link:
+ :paramtype next_link: str
"""
super().__init__(**kwargs)
- self.is_supported = None
- self.filters = filters
-
+ self.value = value
+ self.next_link = next_link
-class FusionSubTypeSeverityFiltersItem(_serialization.Model):
- """Represents a Severity filter setting for a given source subtype consumed in Fusion detection.
- All required parameters must be populated in order to send to Azure.
+class InstructionStep(_serialization.Model):
+ """Instruction steps to enable the connector.
- :ivar severity: The Severity for a given source subtype consumed in Fusion detection. Required.
- Known values are: "High", "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar enabled: Determines whether this severity is enabled or disabled for this source subtype
- consumed in Fusion detection. Required.
- :vartype enabled: bool
+ :ivar title: Gets or sets the instruction step title.
+ :vartype title: str
+ :ivar description: Gets or sets the instruction step description.
+ :vartype description: str
+ :ivar instructions: Gets or sets the instruction step details.
+ :vartype instructions: list[~azure.mgmt.securityinsight.models.InstructionStepDetails]
+ :ivar inner_steps: Gets or sets the inner instruction steps details.
+ For Example: instruction step 1 might contain inner instruction steps: [instruction step 1.1,
+ instruction step 1.2].
+ :vartype inner_steps: list[~azure.mgmt.securityinsight.models.InstructionStep]
"""
- _validation = {
- "severity": {"required": True},
- "enabled": {"required": True},
- }
-
_attribute_map = {
- "severity": {"key": "severity", "type": "str"},
- "enabled": {"key": "enabled", "type": "bool"},
+ "title": {"key": "title", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "instructions": {"key": "instructions", "type": "[InstructionStepDetails]"},
+ "inner_steps": {"key": "innerSteps", "type": "[InstructionStep]"},
}
- def __init__(self, *, severity: Union[str, "_models.AlertSeverity"], enabled: bool, **kwargs):
+ def __init__(
+ self,
+ *,
+ title: Optional[str] = None,
+ description: Optional[str] = None,
+ instructions: Optional[List["_models.InstructionStepDetails"]] = None,
+ inner_steps: Optional[List["_models.InstructionStep"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword severity: The Severity for a given source subtype consumed in Fusion detection.
- Required. Known values are: "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword enabled: Determines whether this severity is enabled or disabled for this source
- subtype consumed in Fusion detection. Required.
- :paramtype enabled: bool
+ :keyword title: Gets or sets the instruction step title.
+ :paramtype title: str
+ :keyword description: Gets or sets the instruction step description.
+ :paramtype description: str
+ :keyword instructions: Gets or sets the instruction step details.
+ :paramtype instructions: list[~azure.mgmt.securityinsight.models.InstructionStepDetails]
+ :keyword inner_steps: Gets or sets the inner instruction steps details.
+ For Example: instruction step 1 might contain inner instruction steps: [instruction step 1.1,
+ instruction step 1.2].
+ :paramtype inner_steps: list[~azure.mgmt.securityinsight.models.InstructionStep]
"""
super().__init__(**kwargs)
- self.severity = severity
- self.enabled = enabled
+ self.title = title
+ self.description = description
+ self.instructions = instructions
+ self.inner_steps = inner_steps
-class FusionTemplateSourceSetting(_serialization.Model):
- """Represents a source signal consumed in Fusion detection.
+class InstructionStepDetails(_serialization.Model):
+ """Instruction step details, to be displayed in the Instructions steps section in the connector's
+ page in Sentinel Portal.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar source_name: The name of a source signal consumed in Fusion detection. Required.
- :vartype source_name: str
- :ivar source_sub_types: All supported source subtypes under this source signal consumed in
- fusion detection.
- :vartype source_sub_types: list[~azure.mgmt.securityinsight.models.FusionTemplateSourceSubType]
+ :ivar parameters: Gets or sets the instruction type parameters settings. Required.
+ :vartype parameters: JSON
+ :ivar type: Gets or sets the instruction type name. Required.
+ :vartype type: str
"""
_validation = {
- "source_name": {"required": True},
+ "parameters": {"required": True},
+ "type": {"required": True},
}
_attribute_map = {
- "source_name": {"key": "sourceName", "type": "str"},
- "source_sub_types": {"key": "sourceSubTypes", "type": "[FusionTemplateSourceSubType]"},
+ "parameters": {"key": "parameters", "type": "object"},
+ "type": {"key": "type", "type": "str"},
}
- def __init__(
- self,
- *,
- source_name: str,
- source_sub_types: Optional[List["_models.FusionTemplateSourceSubType"]] = None,
- **kwargs
- ):
+ def __init__(self, *, parameters: JSON, type: str, **kwargs: Any) -> None:
"""
- :keyword source_name: The name of a source signal consumed in Fusion detection. Required.
- :paramtype source_name: str
- :keyword source_sub_types: All supported source subtypes under this source signal consumed in
- fusion detection.
- :paramtype source_sub_types:
- list[~azure.mgmt.securityinsight.models.FusionTemplateSourceSubType]
+ :keyword parameters: Gets or sets the instruction type parameters settings. Required.
+ :paramtype parameters: JSON
+ :keyword type: Gets or sets the instruction type name. Required.
+ :paramtype type: str
"""
super().__init__(**kwargs)
- self.source_name = source_name
- self.source_sub_types = source_sub_types
+ self.parameters = parameters
+ self.type = type
-class FusionTemplateSourceSubType(_serialization.Model):
- """Represents a source subtype under a source signal consumed in Fusion detection.
+class IoTDeviceEntity(Entity):
+ """Represents an IoT device entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar source_sub_type_name: The name of source subtype under a source signal consumed in Fusion
- detection. Required.
- :vartype source_sub_type_name: str
- :ivar source_sub_type_display_name: The display name of source subtype under a source signal
- consumed in Fusion detection.
- :vartype source_sub_type_display_name: str
- :ivar severity_filter: Severity configuration available for a source subtype consumed in fusion
- detection. Required.
- :vartype severity_filter:
- ~azure.mgmt.securityinsight.models.FusionTemplateSubTypeSeverityFilter
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar device_id: The ID of the IoT Device in the IoT Hub.
+ :vartype device_id: str
+ :ivar device_name: The friendly name of the device.
+ :vartype device_name: str
+ :ivar source: The source of the device.
+ :vartype source: str
+ :ivar iot_security_agent_id: The ID of the security agent running on the device.
+ :vartype iot_security_agent_id: str
+ :ivar device_type: The type of the device.
+ :vartype device_type: str
+ :ivar vendor: The vendor of the device.
+ :vartype vendor: str
+ :ivar edge_id: The ID of the edge device.
+ :vartype edge_id: str
+ :ivar mac_address: The MAC address of the device.
+ :vartype mac_address: str
+ :ivar model: The model of the device.
+ :vartype model: str
+ :ivar serial_number: The serial number of the device.
+ :vartype serial_number: str
+ :ivar firmware_version: The firmware version of the device.
+ :vartype firmware_version: str
+ :ivar operating_system: The operating system of the device.
+ :vartype operating_system: str
+ :ivar iot_hub_entity_id: The AzureResource entity id of the IoT Hub.
+ :vartype iot_hub_entity_id: str
+ :ivar host_entity_id: The Host entity id of this device.
+ :vartype host_entity_id: str
+ :ivar ip_address_entity_id: The IP entity if of this device.
+ :vartype ip_address_entity_id: str
+ :ivar threat_intelligence: A list of TI contexts attached to the IoTDevice entity.
+ :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
+ :ivar protocols: A list of protocols of the IoTDevice entity.
+ :vartype protocols: list[str]
"""
_validation = {
- "source_sub_type_name": {"required": True},
- "source_sub_type_display_name": {"readonly": True},
- "severity_filter": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "device_id": {"readonly": True},
+ "device_name": {"readonly": True},
+ "source": {"readonly": True},
+ "iot_security_agent_id": {"readonly": True},
+ "device_type": {"readonly": True},
+ "vendor": {"readonly": True},
+ "edge_id": {"readonly": True},
+ "mac_address": {"readonly": True},
+ "model": {"readonly": True},
+ "serial_number": {"readonly": True},
+ "firmware_version": {"readonly": True},
+ "operating_system": {"readonly": True},
+ "iot_hub_entity_id": {"readonly": True},
+ "host_entity_id": {"readonly": True},
+ "ip_address_entity_id": {"readonly": True},
+ "threat_intelligence": {"readonly": True},
+ "protocols": {"readonly": True},
}
_attribute_map = {
- "source_sub_type_name": {"key": "sourceSubTypeName", "type": "str"},
- "source_sub_type_display_name": {"key": "sourceSubTypeDisplayName", "type": "str"},
- "severity_filter": {"key": "severityFilter", "type": "FusionTemplateSubTypeSeverityFilter"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "kind": {"key": "kind", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "device_id": {"key": "properties.deviceId", "type": "str"},
+ "device_name": {"key": "properties.deviceName", "type": "str"},
+ "source": {"key": "properties.source", "type": "str"},
+ "iot_security_agent_id": {"key": "properties.iotSecurityAgentId", "type": "str"},
+ "device_type": {"key": "properties.deviceType", "type": "str"},
+ "vendor": {"key": "properties.vendor", "type": "str"},
+ "edge_id": {"key": "properties.edgeId", "type": "str"},
+ "mac_address": {"key": "properties.macAddress", "type": "str"},
+ "model": {"key": "properties.model", "type": "str"},
+ "serial_number": {"key": "properties.serialNumber", "type": "str"},
+ "firmware_version": {"key": "properties.firmwareVersion", "type": "str"},
+ "operating_system": {"key": "properties.operatingSystem", "type": "str"},
+ "iot_hub_entity_id": {"key": "properties.iotHubEntityId", "type": "str"},
+ "host_entity_id": {"key": "properties.hostEntityId", "type": "str"},
+ "ip_address_entity_id": {"key": "properties.ipAddressEntityId", "type": "str"},
+ "threat_intelligence": {"key": "properties.threatIntelligence", "type": "[ThreatIntelligence]"},
+ "protocols": {"key": "properties.protocols", "type": "[str]"},
}
- def __init__(
- self, *, source_sub_type_name: str, severity_filter: "_models.FusionTemplateSubTypeSeverityFilter", **kwargs
- ):
- """
- :keyword source_sub_type_name: The name of source subtype under a source signal consumed in
- Fusion detection. Required.
- :paramtype source_sub_type_name: str
- :keyword severity_filter: Severity configuration available for a source subtype consumed in
- fusion detection. Required.
- :paramtype severity_filter:
- ~azure.mgmt.securityinsight.models.FusionTemplateSubTypeSeverityFilter
- """
+ def __init__(self, **kwargs: Any) -> None: # pylint: disable=too-many-locals
+ """ """
super().__init__(**kwargs)
- self.source_sub_type_name = source_sub_type_name
- self.source_sub_type_display_name = None
- self.severity_filter = severity_filter
+ self.kind: str = "IoTDevice"
+ self.additional_data = None
+ self.friendly_name = None
+ self.device_id = None
+ self.device_name = None
+ self.source = None
+ self.iot_security_agent_id = None
+ self.device_type = None
+ self.vendor = None
+ self.edge_id = None
+ self.mac_address = None
+ self.model = None
+ self.serial_number = None
+ self.firmware_version = None
+ self.operating_system = None
+ self.iot_hub_entity_id = None
+ self.host_entity_id = None
+ self.ip_address_entity_id = None
+ self.threat_intelligence = None
+ self.protocols = None
-class FusionTemplateSubTypeSeverityFilter(_serialization.Model):
- """Represents severity configurations available for a source subtype consumed in Fusion detection.
+class IoTDeviceEntityProperties(EntityCommonProperties):
+ """IoTDevice entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar is_supported: Determines whether severity configuration is supported for this source
- subtype consumed in Fusion detection. Required.
- :vartype is_supported: bool
- :ivar severity_filters: List of all supported severities for this source subtype consumed in
- Fusion detection.
- :vartype severity_filters: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar device_id: The ID of the IoT Device in the IoT Hub.
+ :vartype device_id: str
+ :ivar device_name: The friendly name of the device.
+ :vartype device_name: str
+ :ivar source: The source of the device.
+ :vartype source: str
+ :ivar iot_security_agent_id: The ID of the security agent running on the device.
+ :vartype iot_security_agent_id: str
+ :ivar device_type: The type of the device.
+ :vartype device_type: str
+ :ivar vendor: The vendor of the device.
+ :vartype vendor: str
+ :ivar edge_id: The ID of the edge device.
+ :vartype edge_id: str
+ :ivar mac_address: The MAC address of the device.
+ :vartype mac_address: str
+ :ivar model: The model of the device.
+ :vartype model: str
+ :ivar serial_number: The serial number of the device.
+ :vartype serial_number: str
+ :ivar firmware_version: The firmware version of the device.
+ :vartype firmware_version: str
+ :ivar operating_system: The operating system of the device.
+ :vartype operating_system: str
+ :ivar iot_hub_entity_id: The AzureResource entity id of the IoT Hub.
+ :vartype iot_hub_entity_id: str
+ :ivar host_entity_id: The Host entity id of this device.
+ :vartype host_entity_id: str
+ :ivar ip_address_entity_id: The IP entity if of this device.
+ :vartype ip_address_entity_id: str
+ :ivar threat_intelligence: A list of TI contexts attached to the IoTDevice entity.
+ :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
+ :ivar protocols: A list of protocols of the IoTDevice entity.
+ :vartype protocols: list[str]
"""
_validation = {
- "is_supported": {"required": True},
- }
-
- _attribute_map = {
- "is_supported": {"key": "isSupported", "type": "bool"},
- "severity_filters": {"key": "severityFilters", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- is_supported: bool,
- severity_filters: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- **kwargs
- ):
- """
- :keyword is_supported: Determines whether severity configuration is supported for this source
- subtype consumed in Fusion detection. Required.
- :paramtype is_supported: bool
- :keyword severity_filters: List of all supported severities for this source subtype consumed in
- Fusion detection.
- :paramtype severity_filters: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- """
- super().__init__(**kwargs)
- self.is_supported = is_supported
- self.severity_filters = severity_filters
-
-
-class GeoLocation(_serialization.Model):
- """The geo-location context attached to the ip entity.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar asn: Autonomous System Number.
- :vartype asn: int
- :ivar city: City name.
- :vartype city: str
- :ivar country_code: The country code according to ISO 3166 format.
- :vartype country_code: str
- :ivar country_name: Country name according to ISO 3166 Alpha 2: the lowercase of the English
- Short Name.
- :vartype country_name: str
- :ivar latitude: The longitude of the identified location, expressed as a floating point number
- with range of -180 to 180, with positive numbers representing East and negative numbers
- representing West. Latitude and longitude are derived from the city or postal code.
- :vartype latitude: float
- :ivar longitude: The latitude of the identified location, expressed as a floating point number
- with range of - 90 to 90, with positive numbers representing North and negative numbers
- representing South. Latitude and longitude are derived from the city or postal code.
- :vartype longitude: float
- :ivar state: State name.
- :vartype state: str
- """
-
- _validation = {
- "asn": {"readonly": True},
- "city": {"readonly": True},
- "country_code": {"readonly": True},
- "country_name": {"readonly": True},
- "latitude": {"readonly": True},
- "longitude": {"readonly": True},
- "state": {"readonly": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "device_id": {"readonly": True},
+ "device_name": {"readonly": True},
+ "source": {"readonly": True},
+ "iot_security_agent_id": {"readonly": True},
+ "device_type": {"readonly": True},
+ "vendor": {"readonly": True},
+ "edge_id": {"readonly": True},
+ "mac_address": {"readonly": True},
+ "model": {"readonly": True},
+ "serial_number": {"readonly": True},
+ "firmware_version": {"readonly": True},
+ "operating_system": {"readonly": True},
+ "iot_hub_entity_id": {"readonly": True},
+ "host_entity_id": {"readonly": True},
+ "ip_address_entity_id": {"readonly": True},
+ "threat_intelligence": {"readonly": True},
+ "protocols": {"readonly": True},
}
_attribute_map = {
- "asn": {"key": "asn", "type": "int"},
- "city": {"key": "city", "type": "str"},
- "country_code": {"key": "countryCode", "type": "str"},
- "country_name": {"key": "countryName", "type": "str"},
- "latitude": {"key": "latitude", "type": "float"},
- "longitude": {"key": "longitude", "type": "float"},
- "state": {"key": "state", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "device_id": {"key": "deviceId", "type": "str"},
+ "device_name": {"key": "deviceName", "type": "str"},
+ "source": {"key": "source", "type": "str"},
+ "iot_security_agent_id": {"key": "iotSecurityAgentId", "type": "str"},
+ "device_type": {"key": "deviceType", "type": "str"},
+ "vendor": {"key": "vendor", "type": "str"},
+ "edge_id": {"key": "edgeId", "type": "str"},
+ "mac_address": {"key": "macAddress", "type": "str"},
+ "model": {"key": "model", "type": "str"},
+ "serial_number": {"key": "serialNumber", "type": "str"},
+ "firmware_version": {"key": "firmwareVersion", "type": "str"},
+ "operating_system": {"key": "operatingSystem", "type": "str"},
+ "iot_hub_entity_id": {"key": "iotHubEntityId", "type": "str"},
+ "host_entity_id": {"key": "hostEntityId", "type": "str"},
+ "ip_address_entity_id": {"key": "ipAddressEntityId", "type": "str"},
+ "threat_intelligence": {"key": "threatIntelligence", "type": "[ThreatIntelligence]"},
+ "protocols": {"key": "protocols", "type": "[str]"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
- self.asn = None
- self.city = None
- self.country_code = None
- self.country_name = None
- self.latitude = None
- self.longitude = None
- self.state = None
+ self.device_id = None
+ self.device_name = None
+ self.source = None
+ self.iot_security_agent_id = None
+ self.device_type = None
+ self.vendor = None
+ self.edge_id = None
+ self.mac_address = None
+ self.model = None
+ self.serial_number = None
+ self.firmware_version = None
+ self.operating_system = None
+ self.iot_hub_entity_id = None
+ self.host_entity_id = None
+ self.ip_address_entity_id = None
+ self.threat_intelligence = None
+ self.protocols = None
+
+class IpEntity(Entity):
+ """Represents an ip entity.
-class GetInsightsErrorKind(_serialization.Model):
- """GetInsights Query Errors.
+ 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.
+ All required parameters must be populated in order to send to server.
- :ivar kind: the query kind. Required. "Insight"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.GetInsightsError
- :ivar query_id: the query id.
- :vartype query_id: str
- :ivar error_message: the error message. Required.
- :vartype error_message: str
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar address: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6).
+ :vartype address: str
+ :ivar location: The geo-location context attached to the ip entity.
+ :vartype location: ~azure.mgmt.securityinsight.models.GeoLocation
+ :ivar threat_intelligence: A list of TI contexts attached to the ip entity.
+ :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
"""
_validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
"kind": {"required": True},
- "error_message": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "address": {"readonly": True},
+ "location": {"readonly": True},
+ "threat_intelligence": {"readonly": True},
}
_attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
"kind": {"key": "kind", "type": "str"},
- "query_id": {"key": "queryId", "type": "str"},
- "error_message": {"key": "errorMessage", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "address": {"key": "properties.address", "type": "str"},
+ "location": {"key": "properties.location", "type": "GeoLocation"},
+ "threat_intelligence": {"key": "properties.threatIntelligence", "type": "[ThreatIntelligence]"},
}
- def __init__(
- self,
- *,
- kind: Union[str, "_models.GetInsightsError"],
- error_message: str,
- query_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword kind: the query kind. Required. "Insight"
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.GetInsightsError
- :keyword query_id: the query id.
- :paramtype query_id: str
- :keyword error_message: the error message. Required.
- :paramtype error_message: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.kind = kind
- self.query_id = query_id
- self.error_message = error_message
+ self.kind: str = "Ip"
+ self.additional_data = None
+ self.friendly_name = None
+ self.address = None
+ self.location = None
+ self.threat_intelligence = None
-class GetInsightsResultsMetadata(_serialization.Model):
- """Get Insights result metadata.
+class IpEntityProperties(EntityCommonProperties):
+ """Ip entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar total_count: the total items found for the insights request. Required.
- :vartype total_count: int
- :ivar errors: information about the failed queries.
- :vartype errors: list[~azure.mgmt.securityinsight.models.GetInsightsErrorKind]
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar address: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6).
+ :vartype address: str
+ :ivar location: The geo-location context attached to the ip entity.
+ :vartype location: ~azure.mgmt.securityinsight.models.GeoLocation
+ :ivar threat_intelligence: A list of TI contexts attached to the ip entity.
+ :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
"""
_validation = {
- "total_count": {"required": True},
- }
-
- _attribute_map = {
- "total_count": {"key": "totalCount", "type": "int"},
- "errors": {"key": "errors", "type": "[GetInsightsErrorKind]"},
- }
-
- def __init__(self, *, total_count: int, errors: Optional[List["_models.GetInsightsErrorKind"]] = None, **kwargs):
- """
- :keyword total_count: the total items found for the insights request. Required.
- :paramtype total_count: int
- :keyword errors: information about the failed queries.
- :paramtype errors: list[~azure.mgmt.securityinsight.models.GetInsightsErrorKind]
- """
- super().__init__(**kwargs)
- self.total_count = total_count
- self.errors = errors
-
-
-class GetQueriesResponse(_serialization.Model):
- """Retrieve queries for entity result operation response.
-
- :ivar value: The query result values.
- :vartype value: list[~azure.mgmt.securityinsight.models.EntityQueryItem]
- """
-
- _attribute_map = {
- "value": {"key": "value", "type": "[EntityQueryItem]"},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "address": {"readonly": True},
+ "location": {"readonly": True},
+ "threat_intelligence": {"readonly": True},
}
- def __init__(self, *, value: Optional[List["_models.EntityQueryItem"]] = None, **kwargs):
- """
- :keyword value: The query result values.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQueryItem]
- """
- super().__init__(**kwargs)
- self.value = value
-
-
-class GitHubResourceInfo(_serialization.Model):
- """Resources created in GitHub repository.
-
- :ivar app_installation_id: GitHub application installation id.
- :vartype app_installation_id: str
- """
-
_attribute_map = {
- "app_installation_id": {"key": "appInstallationId", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "address": {"key": "address", "type": "str"},
+ "location": {"key": "location", "type": "GeoLocation"},
+ "threat_intelligence": {"key": "threatIntelligence", "type": "[ThreatIntelligence]"},
}
- def __init__(self, *, app_installation_id: Optional[str] = None, **kwargs):
- """
- :keyword app_installation_id: GitHub application installation id.
- :paramtype app_installation_id: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.app_installation_id = app_installation_id
+ self.address = None
+ self.location = None
+ self.threat_intelligence = None
-class GroupingConfiguration(_serialization.Model):
- """Grouping configuration property bag.
+class JwtAuthModel(CcpAuthConfig):
+ """Model for API authentication with JWT. Simple exchange between user name + password to access
+ token.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar enabled: Grouping enabled. Required.
- :vartype enabled: bool
- :ivar reopen_closed_incident: Re-open closed matching incidents. Required.
- :vartype reopen_closed_incident: bool
- :ivar lookback_duration: Limit the group to alerts created within the lookback duration (in ISO
- 8601 duration format). Required.
- :vartype lookback_duration: ~datetime.timedelta
- :ivar matching_method: Grouping matching method. When method is Selected at least one of
- groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty.
- Required. Known values are: "AllEntities", "AnyAlert", and "Selected".
- :vartype matching_method: str or ~azure.mgmt.securityinsight.models.MatchingMethod
- :ivar group_by_entities: A list of entity types to group by (when matchingMethod is Selected).
- Only entities defined in the current alert rule may be used.
- :vartype group_by_entities: list[str or ~azure.mgmt.securityinsight.models.EntityMappingType]
- :ivar group_by_alert_details: A list of alert details to group by (when matchingMethod is
- Selected).
- :vartype group_by_alert_details: list[str or ~azure.mgmt.securityinsight.models.AlertDetail]
- :ivar group_by_custom_details: A list of custom details keys to group by (when matchingMethod
- is Selected). Only keys defined in the current alert rule may be used.
- :vartype group_by_custom_details: list[str]
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar token_endpoint: Token endpoint to request JWT. Required.
+ :vartype token_endpoint: str
+ :ivar user_name: The user name. If user name and password sent in header request we only need
+ to populate the ``value`` property with the user name (Same as basic auth). If user name and
+ password sent in body request we need to specify the ``Key`` and ``Value``. Required.
+ :vartype user_name: dict[str, str]
+ :ivar password: The password. Required.
+ :vartype password: dict[str, str]
+ :ivar query_parameters: The custom query parameter we want to add once we send request to token
+ endpoint.
+ :vartype query_parameters: dict[str, str]
+ :ivar headers: The custom headers we want to add once we send request to token endpoint.
+ :vartype headers: dict[str, str]
+ :ivar is_credentials_in_headers: Flag indicating whether we want to send the user name and
+ password to token endpoint in the headers.
+ :vartype is_credentials_in_headers: bool
+ :ivar is_json_request: Flag indicating whether the body request is JSON (header Content-Type =
+ application/json), meaning its a Form URL encoded request (header Content-Type =
+ application/x-www-form-urlencoded).
+ :vartype is_json_request: bool
+ :ivar request_timeout_in_seconds: Request timeout in seconds.
+ :vartype request_timeout_in_seconds: int
"""
_validation = {
- "enabled": {"required": True},
- "reopen_closed_incident": {"required": True},
- "lookback_duration": {"required": True},
- "matching_method": {"required": True},
+ "type": {"required": True},
+ "token_endpoint": {"required": True},
+ "user_name": {"required": True},
+ "password": {"required": True},
+ "request_timeout_in_seconds": {"maximum": 180},
}
_attribute_map = {
- "enabled": {"key": "enabled", "type": "bool"},
- "reopen_closed_incident": {"key": "reopenClosedIncident", "type": "bool"},
- "lookback_duration": {"key": "lookbackDuration", "type": "duration"},
- "matching_method": {"key": "matchingMethod", "type": "str"},
- "group_by_entities": {"key": "groupByEntities", "type": "[str]"},
- "group_by_alert_details": {"key": "groupByAlertDetails", "type": "[str]"},
- "group_by_custom_details": {"key": "groupByCustomDetails", "type": "[str]"},
+ "type": {"key": "type", "type": "str"},
+ "token_endpoint": {"key": "tokenEndpoint", "type": "str"},
+ "user_name": {"key": "userName", "type": "{str}"},
+ "password": {"key": "password", "type": "{str}"},
+ "query_parameters": {"key": "queryParameters", "type": "{str}"},
+ "headers": {"key": "headers", "type": "{str}"},
+ "is_credentials_in_headers": {"key": "isCredentialsInHeaders", "type": "bool"},
+ "is_json_request": {"key": "isJsonRequest", "type": "bool"},
+ "request_timeout_in_seconds": {"key": "requestTimeoutInSeconds", "type": "int"},
}
def __init__(
self,
*,
- enabled: bool,
- reopen_closed_incident: bool,
- lookback_duration: datetime.timedelta,
- matching_method: Union[str, "_models.MatchingMethod"],
- group_by_entities: Optional[List[Union[str, "_models.EntityMappingType"]]] = None,
- group_by_alert_details: Optional[List[Union[str, "_models.AlertDetail"]]] = None,
- group_by_custom_details: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword enabled: Grouping enabled. Required.
- :paramtype enabled: bool
- :keyword reopen_closed_incident: Re-open closed matching incidents. Required.
- :paramtype reopen_closed_incident: bool
- :keyword lookback_duration: Limit the group to alerts created within the lookback duration (in
- ISO 8601 duration format). Required.
- :paramtype lookback_duration: ~datetime.timedelta
- :keyword matching_method: Grouping matching method. When method is Selected at least one of
- groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty.
- Required. Known values are: "AllEntities", "AnyAlert", and "Selected".
- :paramtype matching_method: str or ~azure.mgmt.securityinsight.models.MatchingMethod
- :keyword group_by_entities: A list of entity types to group by (when matchingMethod is
- Selected). Only entities defined in the current alert rule may be used.
- :paramtype group_by_entities: list[str or ~azure.mgmt.securityinsight.models.EntityMappingType]
- :keyword group_by_alert_details: A list of alert details to group by (when matchingMethod is
- Selected).
- :paramtype group_by_alert_details: list[str or ~azure.mgmt.securityinsight.models.AlertDetail]
- :keyword group_by_custom_details: A list of custom details keys to group by (when
- matchingMethod is Selected). Only keys defined in the current alert rule may be used.
- :paramtype group_by_custom_details: list[str]
- """
- super().__init__(**kwargs)
- self.enabled = enabled
- self.reopen_closed_incident = reopen_closed_incident
- self.lookback_duration = lookback_duration
- self.matching_method = matching_method
- self.group_by_entities = group_by_entities
- self.group_by_alert_details = group_by_alert_details
- self.group_by_custom_details = group_by_custom_details
+ token_endpoint: str,
+ user_name: Dict[str, str],
+ password: Dict[str, str],
+ query_parameters: Optional[Dict[str, str]] = None,
+ headers: Optional[Dict[str, str]] = None,
+ is_credentials_in_headers: Optional[bool] = None,
+ is_json_request: bool = False,
+ request_timeout_in_seconds: int = 100,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword token_endpoint: Token endpoint to request JWT. Required.
+ :paramtype token_endpoint: str
+ :keyword user_name: The user name. If user name and password sent in header request we only
+ need to populate the ``value`` property with the user name (Same as basic auth). If user name
+ and password sent in body request we need to specify the ``Key`` and ``Value``. Required.
+ :paramtype user_name: dict[str, str]
+ :keyword password: The password. Required.
+ :paramtype password: dict[str, str]
+ :keyword query_parameters: The custom query parameter we want to add once we send request to
+ token endpoint.
+ :paramtype query_parameters: dict[str, str]
+ :keyword headers: The custom headers we want to add once we send request to token endpoint.
+ :paramtype headers: dict[str, str]
+ :keyword is_credentials_in_headers: Flag indicating whether we want to send the user name and
+ password to token endpoint in the headers.
+ :paramtype is_credentials_in_headers: bool
+ :keyword is_json_request: Flag indicating whether the body request is JSON (header Content-Type
+ = application/json), meaning its a Form URL encoded request (header Content-Type =
+ application/x-www-form-urlencoded).
+ :paramtype is_json_request: bool
+ :keyword request_timeout_in_seconds: Request timeout in seconds.
+ :paramtype request_timeout_in_seconds: int
+ """
+ super().__init__(**kwargs)
+ self.type: str = "JwtToken"
+ self.token_endpoint = token_endpoint
+ self.user_name = user_name
+ self.password = password
+ self.query_parameters = query_parameters
+ self.headers = headers
+ self.is_credentials_in_headers = is_credentials_in_headers
+ self.is_json_request = is_json_request
+ self.request_timeout_in_seconds = request_timeout_in_seconds
-class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a host entity.
+class MailboxEntity(Entity):
+ """Represents a mailbox entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -9638,36 +7103,23 @@ class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar azure_id: The azure resource id of the VM.
- :vartype azure_id: str
- :ivar dns_domain: The DNS domain that this host belongs to. Should contain the compete DNS
- suffix for the domain.
- :vartype dns_domain: str
- :ivar host_name: The hostname without the domain suffix.
- :vartype host_name: str
- :ivar is_domain_joined: Determines whether this host belongs to a domain.
- :vartype is_domain_joined: bool
- :ivar net_bios_name: The host name (pre-windows2000).
- :vartype net_bios_name: str
- :ivar nt_domain: The NT domain that this host belongs to.
- :vartype nt_domain: str
- :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed.
- :vartype oms_agent_id: str
- :ivar os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
- "IOS", and "Unknown".
- :vartype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
- :ivar os_version: A free text representation of the operating system. This field is meant to
- hold specific versions the are more fine grained than OSFamily or future values not supported
- by OSFamily enumeration.
- :vartype os_version: str
+ :ivar mailbox_primary_address: The mailbox's primary address.
+ :vartype mailbox_primary_address: str
+ :ivar display_name: The mailbox's display name.
+ :vartype display_name: str
+ :ivar upn: The mailbox's UPN.
+ :vartype upn: str
+ :ivar external_directory_object_id: The AzureAD identifier of mailbox. Similar to AadUserId in
+ account entity but this property is specific to mailbox object on office side.
+ :vartype external_directory_object_id: str
"""
_validation = {
@@ -9678,14 +7130,10 @@ class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"required": True},
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- "azure_id": {"readonly": True},
- "dns_domain": {"readonly": True},
- "host_name": {"readonly": True},
- "is_domain_joined": {"readonly": True},
- "net_bios_name": {"readonly": True},
- "nt_domain": {"readonly": True},
- "oms_agent_id": {"readonly": True},
- "os_version": {"readonly": True},
+ "mailbox_primary_address": {"readonly": True},
+ "display_name": {"readonly": True},
+ "upn": {"readonly": True},
+ "external_directory_object_id": {"readonly": True},
}
_attribute_map = {
@@ -9696,40 +7144,26 @@ class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"key": "kind", "type": "str"},
"additional_data": {"key": "properties.additionalData", "type": "{object}"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "azure_id": {"key": "properties.azureID", "type": "str"},
- "dns_domain": {"key": "properties.dnsDomain", "type": "str"},
- "host_name": {"key": "properties.hostName", "type": "str"},
- "is_domain_joined": {"key": "properties.isDomainJoined", "type": "bool"},
- "net_bios_name": {"key": "properties.netBiosName", "type": "str"},
- "nt_domain": {"key": "properties.ntDomain", "type": "str"},
- "oms_agent_id": {"key": "properties.omsAgentID", "type": "str"},
- "os_family": {"key": "properties.osFamily", "type": "str"},
- "os_version": {"key": "properties.osVersion", "type": "str"},
+ "mailbox_primary_address": {"key": "properties.mailboxPrimaryAddress", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "upn": {"key": "properties.upn", "type": "str"},
+ "external_directory_object_id": {"key": "properties.externalDirectoryObjectId", "type": "str"},
}
- def __init__(self, *, os_family: Optional[Union[str, "_models.OSFamily"]] = None, **kwargs):
- """
- :keyword os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
- "IOS", and "Unknown".
- :paramtype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.kind: str = "Host"
+ self.kind: str = "Mailbox"
self.additional_data = None
self.friendly_name = None
- self.azure_id = None
- self.dns_domain = None
- self.host_name = None
- self.is_domain_joined = None
- self.net_bios_name = None
- self.nt_domain = None
- self.oms_agent_id = None
- self.os_family = os_family
- self.os_version = None
+ self.mailbox_primary_address = None
+ self.display_name = None
+ self.upn = None
+ self.external_directory_object_id = None
-class HostEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Host entity property bag.
+class MailboxEntityProperties(EntityCommonProperties):
+ """Mailbox entity property bag.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -9739,84 +7173,53 @@ class HostEntityProperties(EntityCommonProperties): # pylint: disable=too-many-
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar azure_id: The azure resource id of the VM.
- :vartype azure_id: str
- :ivar dns_domain: The DNS domain that this host belongs to. Should contain the compete DNS
- suffix for the domain.
- :vartype dns_domain: str
- :ivar host_name: The hostname without the domain suffix.
- :vartype host_name: str
- :ivar is_domain_joined: Determines whether this host belongs to a domain.
- :vartype is_domain_joined: bool
- :ivar net_bios_name: The host name (pre-windows2000).
- :vartype net_bios_name: str
- :ivar nt_domain: The NT domain that this host belongs to.
- :vartype nt_domain: str
- :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed.
- :vartype oms_agent_id: str
- :ivar os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
- "IOS", and "Unknown".
- :vartype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
- :ivar os_version: A free text representation of the operating system. This field is meant to
- hold specific versions the are more fine grained than OSFamily or future values not supported
- by OSFamily enumeration.
- :vartype os_version: str
+ :ivar mailbox_primary_address: The mailbox's primary address.
+ :vartype mailbox_primary_address: str
+ :ivar display_name: The mailbox's display name.
+ :vartype display_name: str
+ :ivar upn: The mailbox's UPN.
+ :vartype upn: str
+ :ivar external_directory_object_id: The AzureAD identifier of mailbox. Similar to AadUserId in
+ account entity but this property is specific to mailbox object on office side.
+ :vartype external_directory_object_id: str
"""
_validation = {
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- "azure_id": {"readonly": True},
- "dns_domain": {"readonly": True},
- "host_name": {"readonly": True},
- "is_domain_joined": {"readonly": True},
- "net_bios_name": {"readonly": True},
- "nt_domain": {"readonly": True},
- "oms_agent_id": {"readonly": True},
- "os_version": {"readonly": True},
+ "mailbox_primary_address": {"readonly": True},
+ "display_name": {"readonly": True},
+ "upn": {"readonly": True},
+ "external_directory_object_id": {"readonly": True},
}
_attribute_map = {
"additional_data": {"key": "additionalData", "type": "{object}"},
"friendly_name": {"key": "friendlyName", "type": "str"},
- "azure_id": {"key": "azureID", "type": "str"},
- "dns_domain": {"key": "dnsDomain", "type": "str"},
- "host_name": {"key": "hostName", "type": "str"},
- "is_domain_joined": {"key": "isDomainJoined", "type": "bool"},
- "net_bios_name": {"key": "netBiosName", "type": "str"},
- "nt_domain": {"key": "ntDomain", "type": "str"},
- "oms_agent_id": {"key": "omsAgentID", "type": "str"},
- "os_family": {"key": "osFamily", "type": "str"},
- "os_version": {"key": "osVersion", "type": "str"},
+ "mailbox_primary_address": {"key": "mailboxPrimaryAddress", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "upn": {"key": "upn", "type": "str"},
+ "external_directory_object_id": {"key": "externalDirectoryObjectId", "type": "str"},
}
- def __init__(self, *, os_family: Optional[Union[str, "_models.OSFamily"]] = None, **kwargs):
- """
- :keyword os_family: The operating system type. Known values are: "Linux", "Windows", "Android",
- "IOS", and "Unknown".
- :paramtype os_family: str or ~azure.mgmt.securityinsight.models.OSFamily
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.azure_id = None
- self.dns_domain = None
- self.host_name = None
- self.is_domain_joined = None
- self.net_bios_name = None
- self.nt_domain = None
- self.oms_agent_id = None
- self.os_family = os_family
- self.os_version = None
+ self.mailbox_primary_address = None
+ self.display_name = None
+ self.upn = None
+ self.external_directory_object_id = None
-class HuntingBookmark(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a Hunting bookmark entity.
+class MailClusterEntity(Entity):
+ """Represents a mail cluster entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -9829,36 +7232,45 @@ class HuntingBookmark(Entity): # pylint: disable=too-many-instance-attributes
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar created: The time the bookmark was created.
- :vartype created: ~datetime.datetime
- :ivar created_by: Describes a user that created the bookmark.
- :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
- :ivar display_name: The display name of the bookmark.
- :vartype display_name: str
- :ivar event_time: The time of the event.
- :vartype event_time: ~datetime.datetime
- :ivar labels: List of labels relevant to this bookmark.
- :vartype labels: list[str]
- :ivar notes: The notes of the bookmark.
- :vartype notes: str
- :ivar query: The query of the bookmark.
+ :ivar network_message_ids: The mail message IDs that are part of the mail cluster.
+ :vartype network_message_ids: list[str]
+ :ivar count_by_delivery_status: Count of mail messages by DeliveryStatus string representation.
+ :vartype count_by_delivery_status: JSON
+ :ivar count_by_threat_type: Count of mail messages by ThreatType string representation.
+ :vartype count_by_threat_type: JSON
+ :ivar count_by_protection_status: Count of mail messages by ProtectionStatus string
+ representation.
+ :vartype count_by_protection_status: JSON
+ :ivar threats: The threats of mail messages that are part of the mail cluster.
+ :vartype threats: list[str]
+ :ivar query: The query that was used to identify the messages of the mail cluster.
:vartype query: str
- :ivar query_result: The query result of the bookmark.
- :vartype query_result: str
- :ivar updated: The last time the bookmark was updated.
- :vartype updated: ~datetime.datetime
- :ivar updated_by: Describes a user that updated the bookmark.
- :vartype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
- :ivar incident_info: Describes an incident that relates to bookmark.
- :vartype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
+ :ivar query_time: The query time.
+ :vartype query_time: ~datetime.datetime
+ :ivar mail_count: The number of mail messages that are part of the mail cluster.
+ :vartype mail_count: int
+ :ivar is_volume_anomaly: Is this a volume anomaly mail cluster.
+ :vartype is_volume_anomaly: bool
+ :ivar source: The source of the mail cluster (default is 'O365 ATP').
+ :vartype source: str
+ :ivar cluster_source_identifier: The id of the cluster source.
+ :vartype cluster_source_identifier: str
+ :ivar cluster_source_type: The type of the cluster source.
+ :vartype cluster_source_type: str
+ :ivar cluster_query_start_time: The cluster query start time.
+ :vartype cluster_query_start_time: ~datetime.datetime
+ :ivar cluster_query_end_time: The cluster query end time.
+ :vartype cluster_query_end_time: ~datetime.datetime
+ :ivar cluster_group: The cluster group.
+ :vartype cluster_group: str
"""
_validation = {
@@ -9869,9 +7281,24 @@ class HuntingBookmark(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"required": True},
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- }
-
- _attribute_map = {
+ "network_message_ids": {"readonly": True},
+ "count_by_delivery_status": {"readonly": True},
+ "count_by_threat_type": {"readonly": True},
+ "count_by_protection_status": {"readonly": True},
+ "threats": {"readonly": True},
+ "query": {"readonly": True},
+ "query_time": {"readonly": True},
+ "mail_count": {"readonly": True},
+ "is_volume_anomaly": {"readonly": True},
+ "source": {"readonly": True},
+ "cluster_source_identifier": {"readonly": True},
+ "cluster_source_type": {"readonly": True},
+ "cluster_query_start_time": {"readonly": True},
+ "cluster_query_end_time": {"readonly": True},
+ "cluster_group": {"readonly": True},
+ }
+
+ _attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
@@ -9879,197 +7306,159 @@ class HuntingBookmark(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"key": "kind", "type": "str"},
"additional_data": {"key": "properties.additionalData", "type": "{object}"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "created": {"key": "properties.created", "type": "iso-8601"},
- "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "event_time": {"key": "properties.eventTime", "type": "iso-8601"},
- "labels": {"key": "properties.labels", "type": "[str]"},
- "notes": {"key": "properties.notes", "type": "str"},
+ "network_message_ids": {"key": "properties.networkMessageIds", "type": "[str]"},
+ "count_by_delivery_status": {"key": "properties.countByDeliveryStatus", "type": "object"},
+ "count_by_threat_type": {"key": "properties.countByThreatType", "type": "object"},
+ "count_by_protection_status": {"key": "properties.countByProtectionStatus", "type": "object"},
+ "threats": {"key": "properties.threats", "type": "[str]"},
"query": {"key": "properties.query", "type": "str"},
- "query_result": {"key": "properties.queryResult", "type": "str"},
- "updated": {"key": "properties.updated", "type": "iso-8601"},
- "updated_by": {"key": "properties.updatedBy", "type": "UserInfo"},
- "incident_info": {"key": "properties.incidentInfo", "type": "IncidentInfo"},
+ "query_time": {"key": "properties.queryTime", "type": "iso-8601"},
+ "mail_count": {"key": "properties.mailCount", "type": "int"},
+ "is_volume_anomaly": {"key": "properties.isVolumeAnomaly", "type": "bool"},
+ "source": {"key": "properties.source", "type": "str"},
+ "cluster_source_identifier": {"key": "properties.clusterSourceIdentifier", "type": "str"},
+ "cluster_source_type": {"key": "properties.clusterSourceType", "type": "str"},
+ "cluster_query_start_time": {"key": "properties.clusterQueryStartTime", "type": "iso-8601"},
+ "cluster_query_end_time": {"key": "properties.clusterQueryEndTime", "type": "iso-8601"},
+ "cluster_group": {"key": "properties.clusterGroup", "type": "str"},
}
- def __init__(
- self,
- *,
- created: Optional[datetime.datetime] = None,
- created_by: Optional["_models.UserInfo"] = None,
- display_name: Optional[str] = None,
- event_time: Optional[datetime.datetime] = None,
- labels: Optional[List[str]] = None,
- notes: Optional[str] = None,
- query: Optional[str] = None,
- query_result: Optional[str] = None,
- updated: Optional[datetime.datetime] = None,
- updated_by: Optional["_models.UserInfo"] = None,
- incident_info: Optional["_models.IncidentInfo"] = None,
- **kwargs
- ):
- """
- :keyword created: The time the bookmark was created.
- :paramtype created: ~datetime.datetime
- :keyword created_by: Describes a user that created the bookmark.
- :paramtype created_by: ~azure.mgmt.securityinsight.models.UserInfo
- :keyword display_name: The display name of the bookmark.
- :paramtype display_name: str
- :keyword event_time: The time of the event.
- :paramtype event_time: ~datetime.datetime
- :keyword labels: List of labels relevant to this bookmark.
- :paramtype labels: list[str]
- :keyword notes: The notes of the bookmark.
- :paramtype notes: str
- :keyword query: The query of the bookmark.
- :paramtype query: str
- :keyword query_result: The query result of the bookmark.
- :paramtype query_result: str
- :keyword updated: The last time the bookmark was updated.
- :paramtype updated: ~datetime.datetime
- :keyword updated_by: Describes a user that updated the bookmark.
- :paramtype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
- :keyword incident_info: Describes an incident that relates to bookmark.
- :paramtype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.kind: str = "Bookmark"
+ self.kind: str = "MailCluster"
self.additional_data = None
self.friendly_name = None
- self.created = created
- self.created_by = created_by
- self.display_name = display_name
- self.event_time = event_time
- self.labels = labels
- self.notes = notes
- self.query = query
- self.query_result = query_result
- self.updated = updated
- self.updated_by = updated_by
- self.incident_info = incident_info
+ self.network_message_ids = None
+ self.count_by_delivery_status = None
+ self.count_by_threat_type = None
+ self.count_by_protection_status = None
+ self.threats = None
+ self.query = None
+ self.query_time = None
+ self.mail_count = None
+ self.is_volume_anomaly = None
+ self.source = None
+ self.cluster_source_identifier = None
+ self.cluster_source_type = None
+ self.cluster_query_start_time = None
+ self.cluster_query_end_time = None
+ self.cluster_group = None
-class HuntingBookmarkProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Describes bookmark properties.
+class MailClusterEntityProperties(EntityCommonProperties):
+ """Mail cluster entity property bag.
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 additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar created: The time the bookmark was created.
- :vartype created: ~datetime.datetime
- :ivar created_by: Describes a user that created the bookmark.
- :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
- :ivar display_name: The display name of the bookmark. Required.
- :vartype display_name: str
- :ivar event_time: The time of the event.
- :vartype event_time: ~datetime.datetime
- :ivar labels: List of labels relevant to this bookmark.
- :vartype labels: list[str]
- :ivar notes: The notes of the bookmark.
- :vartype notes: str
- :ivar query: The query of the bookmark. Required.
+ :ivar network_message_ids: The mail message IDs that are part of the mail cluster.
+ :vartype network_message_ids: list[str]
+ :ivar count_by_delivery_status: Count of mail messages by DeliveryStatus string representation.
+ :vartype count_by_delivery_status: JSON
+ :ivar count_by_threat_type: Count of mail messages by ThreatType string representation.
+ :vartype count_by_threat_type: JSON
+ :ivar count_by_protection_status: Count of mail messages by ProtectionStatus string
+ representation.
+ :vartype count_by_protection_status: JSON
+ :ivar threats: The threats of mail messages that are part of the mail cluster.
+ :vartype threats: list[str]
+ :ivar query: The query that was used to identify the messages of the mail cluster.
:vartype query: str
- :ivar query_result: The query result of the bookmark.
- :vartype query_result: str
- :ivar updated: The last time the bookmark was updated.
- :vartype updated: ~datetime.datetime
- :ivar updated_by: Describes a user that updated the bookmark.
- :vartype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
- :ivar incident_info: Describes an incident that relates to bookmark.
- :vartype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
+ :ivar query_time: The query time.
+ :vartype query_time: ~datetime.datetime
+ :ivar mail_count: The number of mail messages that are part of the mail cluster.
+ :vartype mail_count: int
+ :ivar is_volume_anomaly: Is this a volume anomaly mail cluster.
+ :vartype is_volume_anomaly: bool
+ :ivar source: The source of the mail cluster (default is 'O365 ATP').
+ :vartype source: str
+ :ivar cluster_source_identifier: The id of the cluster source.
+ :vartype cluster_source_identifier: str
+ :ivar cluster_source_type: The type of the cluster source.
+ :vartype cluster_source_type: str
+ :ivar cluster_query_start_time: The cluster query start time.
+ :vartype cluster_query_start_time: ~datetime.datetime
+ :ivar cluster_query_end_time: The cluster query end time.
+ :vartype cluster_query_end_time: ~datetime.datetime
+ :ivar cluster_group: The cluster group.
+ :vartype cluster_group: str
"""
_validation = {
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- "display_name": {"required": True},
- "query": {"required": True},
+ "network_message_ids": {"readonly": True},
+ "count_by_delivery_status": {"readonly": True},
+ "count_by_threat_type": {"readonly": True},
+ "count_by_protection_status": {"readonly": True},
+ "threats": {"readonly": True},
+ "query": {"readonly": True},
+ "query_time": {"readonly": True},
+ "mail_count": {"readonly": True},
+ "is_volume_anomaly": {"readonly": True},
+ "source": {"readonly": True},
+ "cluster_source_identifier": {"readonly": True},
+ "cluster_source_type": {"readonly": True},
+ "cluster_query_start_time": {"readonly": True},
+ "cluster_query_end_time": {"readonly": True},
+ "cluster_group": {"readonly": True},
}
_attribute_map = {
"additional_data": {"key": "additionalData", "type": "{object}"},
"friendly_name": {"key": "friendlyName", "type": "str"},
- "created": {"key": "created", "type": "iso-8601"},
- "created_by": {"key": "createdBy", "type": "UserInfo"},
- "display_name": {"key": "displayName", "type": "str"},
- "event_time": {"key": "eventTime", "type": "iso-8601"},
- "labels": {"key": "labels", "type": "[str]"},
- "notes": {"key": "notes", "type": "str"},
+ "network_message_ids": {"key": "networkMessageIds", "type": "[str]"},
+ "count_by_delivery_status": {"key": "countByDeliveryStatus", "type": "object"},
+ "count_by_threat_type": {"key": "countByThreatType", "type": "object"},
+ "count_by_protection_status": {"key": "countByProtectionStatus", "type": "object"},
+ "threats": {"key": "threats", "type": "[str]"},
"query": {"key": "query", "type": "str"},
- "query_result": {"key": "queryResult", "type": "str"},
- "updated": {"key": "updated", "type": "iso-8601"},
- "updated_by": {"key": "updatedBy", "type": "UserInfo"},
- "incident_info": {"key": "incidentInfo", "type": "IncidentInfo"},
+ "query_time": {"key": "queryTime", "type": "iso-8601"},
+ "mail_count": {"key": "mailCount", "type": "int"},
+ "is_volume_anomaly": {"key": "isVolumeAnomaly", "type": "bool"},
+ "source": {"key": "source", "type": "str"},
+ "cluster_source_identifier": {"key": "clusterSourceIdentifier", "type": "str"},
+ "cluster_source_type": {"key": "clusterSourceType", "type": "str"},
+ "cluster_query_start_time": {"key": "clusterQueryStartTime", "type": "iso-8601"},
+ "cluster_query_end_time": {"key": "clusterQueryEndTime", "type": "iso-8601"},
+ "cluster_group": {"key": "clusterGroup", "type": "str"},
}
- def __init__(
- self,
- *,
- display_name: str,
- query: str,
- created: Optional[datetime.datetime] = None,
- created_by: Optional["_models.UserInfo"] = None,
- event_time: Optional[datetime.datetime] = None,
- labels: Optional[List[str]] = None,
- notes: Optional[str] = None,
- query_result: Optional[str] = None,
- updated: Optional[datetime.datetime] = None,
- updated_by: Optional["_models.UserInfo"] = None,
- incident_info: Optional["_models.IncidentInfo"] = None,
- **kwargs
- ):
- """
- :keyword created: The time the bookmark was created.
- :paramtype created: ~datetime.datetime
- :keyword created_by: Describes a user that created the bookmark.
- :paramtype created_by: ~azure.mgmt.securityinsight.models.UserInfo
- :keyword display_name: The display name of the bookmark. Required.
- :paramtype display_name: str
- :keyword event_time: The time of the event.
- :paramtype event_time: ~datetime.datetime
- :keyword labels: List of labels relevant to this bookmark.
- :paramtype labels: list[str]
- :keyword notes: The notes of the bookmark.
- :paramtype notes: str
- :keyword query: The query of the bookmark. Required.
- :paramtype query: str
- :keyword query_result: The query result of the bookmark.
- :paramtype query_result: str
- :keyword updated: The last time the bookmark was updated.
- :paramtype updated: ~datetime.datetime
- :keyword updated_by: Describes a user that updated the bookmark.
- :paramtype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
- :keyword incident_info: Describes an incident that relates to bookmark.
- :paramtype incident_info: ~azure.mgmt.securityinsight.models.IncidentInfo
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.created = created
- self.created_by = created_by
- self.display_name = display_name
- self.event_time = event_time
- self.labels = labels
- self.notes = notes
- self.query = query
- self.query_result = query_result
- self.updated = updated
- self.updated_by = updated_by
- self.incident_info = incident_info
-
-
-class Incident(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Incident.
+ self.network_message_ids = None
+ self.count_by_delivery_status = None
+ self.count_by_threat_type = None
+ self.count_by_protection_status = None
+ self.threats = None
+ self.query = None
+ self.query_time = None
+ self.mail_count = None
+ self.is_volume_anomaly = None
+ self.source = None
+ self.cluster_source_identifier = None
+ self.cluster_source_type = None
+ self.cluster_query_start_time = None
+ self.cluster_query_end_time = None
+ self.cluster_group = None
+
+
+class MailMessageEntity(Entity):
+ """Represents a mail message entity.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -10079,54 +7468,73 @@ class Incident(ResourceWithEtag): # pylint: disable=too-many-instance-attribute
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar title: The title of the incident.
- :vartype title: str
- :ivar description: The description of the incident.
- :vartype description: str
- :ivar severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
- "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
- :ivar status: The status of the incident. Known values are: "New", "Active", and "Closed".
- :vartype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
- :ivar classification: The reason the incident was closed. Known values are: "Undetermined",
- "TruePositive", "BenignPositive", and "FalsePositive".
- :vartype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
- :ivar classification_reason: The classification reason the incident was closed with. Known
- values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
- "InaccurateData".
- :vartype classification_reason: str or
- ~azure.mgmt.securityinsight.models.IncidentClassificationReason
- :ivar classification_comment: Describes the reason the incident was closed.
- :vartype classification_comment: str
- :ivar owner: Describes a user that the incident is assigned to.
- :vartype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
- :ivar labels: List of labels relevant to this incident.
- :vartype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
- :ivar first_activity_time_utc: The time of the first activity in the incident.
- :vartype first_activity_time_utc: ~datetime.datetime
- :ivar last_activity_time_utc: The time of the last activity in the incident.
- :vartype last_activity_time_utc: ~datetime.datetime
- :ivar last_modified_time_utc: The last time the incident was updated.
- :vartype last_modified_time_utc: ~datetime.datetime
- :ivar created_time_utc: The time the incident was created.
- :vartype created_time_utc: ~datetime.datetime
- :ivar incident_number: A sequential number.
- :vartype incident_number: int
- :ivar additional_data: Additional data on the incident.
- :vartype additional_data: ~azure.mgmt.securityinsight.models.IncidentAdditionalData
- :ivar related_analytic_rule_ids: List of resource ids of Analytic rules related to the
- incident.
- :vartype related_analytic_rule_ids: list[str]
- :ivar incident_url: The deep-link url to the incident in Azure portal.
- :vartype incident_url: str
- :ivar provider_name: The name of the source provider that generated the incident.
- :vartype provider_name: str
- :ivar provider_incident_id: The incident ID assigned by the incident provider.
- :vartype provider_incident_id: str
- :ivar team_information: Describes a team for the incident.
- :vartype team_information: ~azure.mgmt.securityinsight.models.TeamInformation
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar file_entity_ids: The File entity ids of this mail message's attachments.
+ :vartype file_entity_ids: list[str]
+ :ivar recipient: The recipient of this mail message. Note that in case of multiple recipients
+ the mail message is forked and each copy has one recipient.
+ :vartype recipient: str
+ :ivar urls: The Urls contained in this mail message.
+ :vartype urls: list[str]
+ :ivar threats: The threats of this mail message.
+ :vartype threats: list[str]
+ :ivar p1_sender: The p1 sender's email address.
+ :vartype p1_sender: str
+ :ivar p1_sender_display_name: The p1 sender's display name.
+ :vartype p1_sender_display_name: str
+ :ivar p1_sender_domain: The p1 sender's domain.
+ :vartype p1_sender_domain: str
+ :ivar sender_ip: The sender's IP address.
+ :vartype sender_ip: str
+ :ivar p2_sender: The p2 sender's email address.
+ :vartype p2_sender: str
+ :ivar p2_sender_display_name: The p2 sender's display name.
+ :vartype p2_sender_display_name: str
+ :ivar p2_sender_domain: The p2 sender's domain.
+ :vartype p2_sender_domain: str
+ :ivar receive_date: The receive date of this message.
+ :vartype receive_date: ~datetime.datetime
+ :ivar network_message_id: The network message id of this mail message.
+ :vartype network_message_id: str
+ :ivar internet_message_id: The internet message id of this mail message.
+ :vartype internet_message_id: str
+ :ivar subject: The subject of this mail message.
+ :vartype subject: str
+ :ivar language: The language of this mail message.
+ :vartype language: str
+ :ivar threat_detection_methods: The threat detection methods.
+ :vartype threat_detection_methods: list[str]
+ :ivar body_fingerprint_bin1: The bodyFingerprintBin1.
+ :vartype body_fingerprint_bin1: int
+ :ivar body_fingerprint_bin2: The bodyFingerprintBin2.
+ :vartype body_fingerprint_bin2: int
+ :ivar body_fingerprint_bin3: The bodyFingerprintBin3.
+ :vartype body_fingerprint_bin3: int
+ :ivar body_fingerprint_bin4: The bodyFingerprintBin4.
+ :vartype body_fingerprint_bin4: int
+ :ivar body_fingerprint_bin5: The bodyFingerprintBin5.
+ :vartype body_fingerprint_bin5: int
+ :ivar antispam_direction: The directionality of this mail message. Known values are: "Unknown",
+ "Inbound", "Outbound", and "Intraorg".
+ :vartype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
+ :ivar delivery_action: The delivery action of this mail message like Delivered, Blocked,
+ Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
+ "Replaced".
+ :vartype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
+ :ivar delivery_location: The delivery location of this mail message like Inbox, JunkFolder etc.
+ Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine", "External",
+ "Failed", "Dropped", and "Forwarded".
+ :vartype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
"""
_validation = {
@@ -10134,12 +7542,26 @@ class Incident(ResourceWithEtag): # pylint: disable=too-many-instance-attribute
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "last_modified_time_utc": {"readonly": True},
- "created_time_utc": {"readonly": True},
- "incident_number": {"readonly": True},
+ "kind": {"required": True},
"additional_data": {"readonly": True},
- "related_analytic_rule_ids": {"readonly": True},
- "incident_url": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "file_entity_ids": {"readonly": True},
+ "recipient": {"readonly": True},
+ "urls": {"readonly": True},
+ "threats": {"readonly": True},
+ "p1_sender": {"readonly": True},
+ "p1_sender_display_name": {"readonly": True},
+ "p1_sender_domain": {"readonly": True},
+ "sender_ip": {"readonly": True},
+ "p2_sender": {"readonly": True},
+ "p2_sender_display_name": {"readonly": True},
+ "p2_sender_domain": {"readonly": True},
+ "receive_date": {"readonly": True},
+ "network_message_id": {"readonly": True},
+ "internet_message_id": {"readonly": True},
+ "subject": {"readonly": True},
+ "language": {"readonly": True},
+ "threat_detection_methods": {"readonly": True},
}
_attribute_map = {
@@ -10147,4647 +7569,297 @@ class Incident(ResourceWithEtag): # pylint: disable=too-many-instance-attribute
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "title": {"key": "properties.title", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "severity": {"key": "properties.severity", "type": "str"},
- "status": {"key": "properties.status", "type": "str"},
- "classification": {"key": "properties.classification", "type": "str"},
- "classification_reason": {"key": "properties.classificationReason", "type": "str"},
- "classification_comment": {"key": "properties.classificationComment", "type": "str"},
- "owner": {"key": "properties.owner", "type": "IncidentOwnerInfo"},
- "labels": {"key": "properties.labels", "type": "[IncidentLabel]"},
- "first_activity_time_utc": {"key": "properties.firstActivityTimeUtc", "type": "iso-8601"},
- "last_activity_time_utc": {"key": "properties.lastActivityTimeUtc", "type": "iso-8601"},
- "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
- "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
- "incident_number": {"key": "properties.incidentNumber", "type": "int"},
- "additional_data": {"key": "properties.additionalData", "type": "IncidentAdditionalData"},
- "related_analytic_rule_ids": {"key": "properties.relatedAnalyticRuleIds", "type": "[str]"},
- "incident_url": {"key": "properties.incidentUrl", "type": "str"},
- "provider_name": {"key": "properties.providerName", "type": "str"},
- "provider_incident_id": {"key": "properties.providerIncidentId", "type": "str"},
- "team_information": {"key": "properties.teamInformation", "type": "TeamInformation"},
+ "kind": {"key": "kind", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "file_entity_ids": {"key": "properties.fileEntityIds", "type": "[str]"},
+ "recipient": {"key": "properties.recipient", "type": "str"},
+ "urls": {"key": "properties.urls", "type": "[str]"},
+ "threats": {"key": "properties.threats", "type": "[str]"},
+ "p1_sender": {"key": "properties.p1Sender", "type": "str"},
+ "p1_sender_display_name": {"key": "properties.p1SenderDisplayName", "type": "str"},
+ "p1_sender_domain": {"key": "properties.p1SenderDomain", "type": "str"},
+ "sender_ip": {"key": "properties.senderIP", "type": "str"},
+ "p2_sender": {"key": "properties.p2Sender", "type": "str"},
+ "p2_sender_display_name": {"key": "properties.p2SenderDisplayName", "type": "str"},
+ "p2_sender_domain": {"key": "properties.p2SenderDomain", "type": "str"},
+ "receive_date": {"key": "properties.receiveDate", "type": "iso-8601"},
+ "network_message_id": {"key": "properties.networkMessageId", "type": "str"},
+ "internet_message_id": {"key": "properties.internetMessageId", "type": "str"},
+ "subject": {"key": "properties.subject", "type": "str"},
+ "language": {"key": "properties.language", "type": "str"},
+ "threat_detection_methods": {"key": "properties.threatDetectionMethods", "type": "[str]"},
+ "body_fingerprint_bin1": {"key": "properties.bodyFingerprintBin1", "type": "int"},
+ "body_fingerprint_bin2": {"key": "properties.bodyFingerprintBin2", "type": "int"},
+ "body_fingerprint_bin3": {"key": "properties.bodyFingerprintBin3", "type": "int"},
+ "body_fingerprint_bin4": {"key": "properties.bodyFingerprintBin4", "type": "int"},
+ "body_fingerprint_bin5": {"key": "properties.bodyFingerprintBin5", "type": "int"},
+ "antispam_direction": {"key": "properties.antispamDirection", "type": "str"},
+ "delivery_action": {"key": "properties.deliveryAction", "type": "str"},
+ "delivery_location": {"key": "properties.deliveryLocation", "type": "str"},
}
def __init__( # pylint: disable=too-many-locals
self,
*,
- etag: Optional[str] = None,
- title: Optional[str] = None,
- description: Optional[str] = None,
- severity: Optional[Union[str, "_models.IncidentSeverity"]] = None,
- status: Optional[Union[str, "_models.IncidentStatus"]] = None,
- classification: Optional[Union[str, "_models.IncidentClassification"]] = None,
- classification_reason: Optional[Union[str, "_models.IncidentClassificationReason"]] = None,
- classification_comment: Optional[str] = None,
- owner: Optional["_models.IncidentOwnerInfo"] = None,
- labels: Optional[List["_models.IncidentLabel"]] = None,
- first_activity_time_utc: Optional[datetime.datetime] = None,
- last_activity_time_utc: Optional[datetime.datetime] = None,
- provider_name: Optional[str] = None,
- provider_incident_id: Optional[str] = None,
- team_information: Optional["_models.TeamInformation"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword title: The title of the incident.
- :paramtype title: str
- :keyword description: The description of the incident.
- :paramtype description: str
- :keyword severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
- "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
- :keyword status: The status of the incident. Known values are: "New", "Active", and "Closed".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
- :keyword classification: The reason the incident was closed. Known values are: "Undetermined",
- "TruePositive", "BenignPositive", and "FalsePositive".
- :paramtype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
- :keyword classification_reason: The classification reason the incident was closed with. Known
- values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
- "InaccurateData".
- :paramtype classification_reason: str or
- ~azure.mgmt.securityinsight.models.IncidentClassificationReason
- :keyword classification_comment: Describes the reason the incident was closed.
- :paramtype classification_comment: str
- :keyword owner: Describes a user that the incident is assigned to.
- :paramtype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
- :keyword labels: List of labels relevant to this incident.
- :paramtype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
- :keyword first_activity_time_utc: The time of the first activity in the incident.
- :paramtype first_activity_time_utc: ~datetime.datetime
- :keyword last_activity_time_utc: The time of the last activity in the incident.
- :paramtype last_activity_time_utc: ~datetime.datetime
- :keyword provider_name: The name of the source provider that generated the incident.
- :paramtype provider_name: str
- :keyword provider_incident_id: The incident ID assigned by the incident provider.
- :paramtype provider_incident_id: str
- :keyword team_information: Describes a team for the incident.
- :paramtype team_information: ~azure.mgmt.securityinsight.models.TeamInformation
+ body_fingerprint_bin1: Optional[int] = None,
+ body_fingerprint_bin2: Optional[int] = None,
+ body_fingerprint_bin3: Optional[int] = None,
+ body_fingerprint_bin4: Optional[int] = None,
+ body_fingerprint_bin5: Optional[int] = None,
+ antispam_direction: Optional[Union[str, "_models.AntispamMailDirection"]] = None,
+ delivery_action: Optional[Union[str, "_models.DeliveryAction"]] = None,
+ delivery_location: Optional[Union[str, "_models.DeliveryLocation"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- super().__init__(etag=etag, **kwargs)
- self.title = title
- self.description = description
- self.severity = severity
- self.status = status
- self.classification = classification
- self.classification_reason = classification_reason
- self.classification_comment = classification_comment
- self.owner = owner
- self.labels = labels
- self.first_activity_time_utc = first_activity_time_utc
- self.last_activity_time_utc = last_activity_time_utc
- self.last_modified_time_utc = None
- self.created_time_utc = None
- self.incident_number = None
- self.additional_data = None
- self.related_analytic_rule_ids = None
- self.incident_url = None
- self.provider_name = provider_name
- self.provider_incident_id = provider_incident_id
- self.team_information = team_information
-
-
-class IncidentAdditionalData(_serialization.Model):
- """Incident additional data property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar alerts_count: The number of alerts in the incident.
- :vartype alerts_count: int
- :ivar bookmarks_count: The number of bookmarks in the incident.
- :vartype bookmarks_count: int
- :ivar comments_count: The number of comments in the incident.
- :vartype comments_count: int
- :ivar alert_product_names: List of product names of alerts in the incident.
- :vartype alert_product_names: list[str]
- :ivar tactics: The tactics associated with incident.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques associated with incident's tactics.
- :vartype techniques: list[str]
- :ivar provider_incident_url: The provider incident url to the incident in Microsoft 365
- Defender portal.
- :vartype provider_incident_url: str
- """
-
- _validation = {
- "alerts_count": {"readonly": True},
- "bookmarks_count": {"readonly": True},
- "comments_count": {"readonly": True},
- "alert_product_names": {"readonly": True},
- "tactics": {"readonly": True},
- "techniques": {"readonly": True},
- "provider_incident_url": {"readonly": True},
- }
-
- _attribute_map = {
- "alerts_count": {"key": "alertsCount", "type": "int"},
- "bookmarks_count": {"key": "bookmarksCount", "type": "int"},
- "comments_count": {"key": "commentsCount", "type": "int"},
- "alert_product_names": {"key": "alertProductNames", "type": "[str]"},
- "tactics": {"key": "tactics", "type": "[str]"},
- "techniques": {"key": "techniques", "type": "[str]"},
- "provider_incident_url": {"key": "providerIncidentUrl", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.alerts_count = None
- self.bookmarks_count = None
- self.comments_count = None
- self.alert_product_names = None
- self.tactics = None
- self.techniques = None
- self.provider_incident_url = None
-
-
-class IncidentAlertList(_serialization.Model):
- """List of incident alerts.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar value: Array of incident alerts. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
- """
-
- _validation = {
- "value": {"required": True},
- }
-
- _attribute_map = {
- "value": {"key": "value", "type": "[SecurityAlert]"},
- }
-
- def __init__(self, *, value: List["_models.SecurityAlert"], **kwargs):
- """
- :keyword value: Array of incident alerts. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
- """
- super().__init__(**kwargs)
- self.value = value
-
-
-class IncidentBookmarkList(_serialization.Model):
- """List of incident bookmarks.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar value: Array of incident bookmarks. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.HuntingBookmark]
- """
-
- _validation = {
- "value": {"required": True},
- }
-
- _attribute_map = {
- "value": {"key": "value", "type": "[HuntingBookmark]"},
- }
-
- def __init__(self, *, value: List["_models.HuntingBookmark"], **kwargs):
- """
- :keyword value: Array of incident bookmarks. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.HuntingBookmark]
- """
- super().__init__(**kwargs)
- self.value = value
-
-
-class IncidentComment(ResourceWithEtag):
- """Represents an incident comment.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar message: The comment message.
- :vartype message: str
- :ivar created_time_utc: The time the comment was created.
- :vartype created_time_utc: ~datetime.datetime
- :ivar last_modified_time_utc: The time the comment was updated.
- :vartype last_modified_time_utc: ~datetime.datetime
- :ivar author: Describes the client that created the comment.
- :vartype author: ~azure.mgmt.securityinsight.models.ClientInfo
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "created_time_utc": {"readonly": True},
- "last_modified_time_utc": {"readonly": True},
- "author": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "message": {"key": "properties.message", "type": "str"},
- "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
- "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
- "author": {"key": "properties.author", "type": "ClientInfo"},
- }
-
- def __init__(self, *, etag: Optional[str] = None, message: Optional[str] = None, **kwargs):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword message: The comment message.
- :paramtype message: str
- """
- super().__init__(etag=etag, **kwargs)
- self.message = message
- self.created_time_utc = None
- self.last_modified_time_utc = None
- self.author = None
-
-
-class IncidentCommentList(_serialization.Model):
- """IncidentCommentList.
-
- 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 value: Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
- :ivar next_link:
- :vartype next_link: str
- """
-
- _validation = {
- "value": {"required": True},
- "next_link": {"readonly": True},
- }
-
- _attribute_map = {
- "value": {"key": "value", "type": "[IncidentComment]"},
- "next_link": {"key": "nextLink", "type": "str"},
- }
-
- def __init__(self, *, value: List["_models.IncidentComment"], **kwargs):
- """
- :keyword value: Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
- """
- super().__init__(**kwargs)
- self.value = value
- self.next_link = None
-
-
-class IncidentConfiguration(_serialization.Model):
- """Incident Configuration property bag.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar create_incident: Create incidents from alerts triggered by this analytics rule. Required.
- :vartype create_incident: bool
- :ivar grouping_configuration: Set how the alerts that are triggered by this analytics rule, are
- grouped into incidents.
- :vartype grouping_configuration: ~azure.mgmt.securityinsight.models.GroupingConfiguration
- """
-
- _validation = {
- "create_incident": {"required": True},
- }
-
- _attribute_map = {
- "create_incident": {"key": "createIncident", "type": "bool"},
- "grouping_configuration": {"key": "groupingConfiguration", "type": "GroupingConfiguration"},
- }
-
- def __init__(
- self,
- *,
- create_incident: bool,
- grouping_configuration: Optional["_models.GroupingConfiguration"] = None,
- **kwargs
- ):
- """
- :keyword create_incident: Create incidents from alerts triggered by this analytics rule.
- Required.
- :paramtype create_incident: bool
- :keyword grouping_configuration: Set how the alerts that are triggered by this analytics rule,
- are grouped into incidents.
- :paramtype grouping_configuration: ~azure.mgmt.securityinsight.models.GroupingConfiguration
- """
- super().__init__(**kwargs)
- self.create_incident = create_incident
- self.grouping_configuration = grouping_configuration
-
-
-class IncidentEntitiesResponse(_serialization.Model):
- """The incident related entities response.
-
- :ivar entities: Array of the incident related entities.
- :vartype entities: list[~azure.mgmt.securityinsight.models.Entity]
- :ivar meta_data: The metadata from the incident related entities results.
- :vartype meta_data: list[~azure.mgmt.securityinsight.models.IncidentEntitiesResultsMetadata]
- """
-
- _attribute_map = {
- "entities": {"key": "entities", "type": "[Entity]"},
- "meta_data": {"key": "metaData", "type": "[IncidentEntitiesResultsMetadata]"},
- }
-
- def __init__(
- self,
- *,
- entities: Optional[List["_models.Entity"]] = None,
- meta_data: Optional[List["_models.IncidentEntitiesResultsMetadata"]] = None,
- **kwargs
- ):
- """
- :keyword entities: Array of the incident related entities.
- :paramtype entities: list[~azure.mgmt.securityinsight.models.Entity]
- :keyword meta_data: The metadata from the incident related entities results.
- :paramtype meta_data: list[~azure.mgmt.securityinsight.models.IncidentEntitiesResultsMetadata]
- """
- super().__init__(**kwargs)
- self.entities = entities
- self.meta_data = meta_data
-
-
-class IncidentEntitiesResultsMetadata(_serialization.Model):
- """Information of a specific aggregation in the incident related entities result.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar entity_kind: The kind of the aggregated entity. Required. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip",
- "Malware", "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice",
- "SecurityAlert", "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and
- "Nic".
- :vartype entity_kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar count: Total number of aggregations of the given kind in the incident related entities
- result. Required.
- :vartype count: int
- """
-
- _validation = {
- "entity_kind": {"required": True},
- "count": {"required": True},
- }
-
- _attribute_map = {
- "entity_kind": {"key": "entityKind", "type": "str"},
- "count": {"key": "count", "type": "int"},
- }
-
- def __init__(self, *, entity_kind: Union[str, "_models.EntityKind"], count: int, **kwargs):
- """
- :keyword entity_kind: The kind of the aggregated entity. Required. Known values are: "Account",
- "Host", "File", "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip",
- "Malware", "Process", "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice",
- "SecurityAlert", "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and
- "Nic".
- :paramtype entity_kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :keyword count: Total number of aggregations of the given kind in the incident related entities
- result. Required.
- :paramtype count: int
- """
- super().__init__(**kwargs)
- self.entity_kind = entity_kind
- self.count = count
-
-
-class IncidentInfo(_serialization.Model):
- """Describes related incident information for the bookmark.
-
- :ivar incident_id: Incident Id.
- :vartype incident_id: str
- :ivar severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
- "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
- :ivar title: The title of the incident.
- :vartype title: str
- :ivar relation_name: Relation Name.
- :vartype relation_name: str
- """
-
- _attribute_map = {
- "incident_id": {"key": "incidentId", "type": "str"},
- "severity": {"key": "severity", "type": "str"},
- "title": {"key": "title", "type": "str"},
- "relation_name": {"key": "relationName", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- incident_id: Optional[str] = None,
- severity: Optional[Union[str, "_models.IncidentSeverity"]] = None,
- title: Optional[str] = None,
- relation_name: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword incident_id: Incident Id.
- :paramtype incident_id: str
- :keyword severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
- "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
- :keyword title: The title of the incident.
- :paramtype title: str
- :keyword relation_name: Relation Name.
- :paramtype relation_name: str
- """
- super().__init__(**kwargs)
- self.incident_id = incident_id
- self.severity = severity
- self.title = title
- self.relation_name = relation_name
-
-
-class IncidentLabel(_serialization.Model):
- """Represents an incident label.
-
- 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 label_name: The name of the label. Required.
- :vartype label_name: str
- :ivar label_type: The type of the label. Known values are: "User" and "AutoAssigned".
- :vartype label_type: str or ~azure.mgmt.securityinsight.models.IncidentLabelType
- """
-
- _validation = {
- "label_name": {"required": True},
- "label_type": {"readonly": True},
- }
-
- _attribute_map = {
- "label_name": {"key": "labelName", "type": "str"},
- "label_type": {"key": "labelType", "type": "str"},
- }
-
- def __init__(self, *, label_name: str, **kwargs):
- """
- :keyword label_name: The name of the label. Required.
- :paramtype label_name: str
- """
- super().__init__(**kwargs)
- self.label_name = label_name
- self.label_type = None
-
-
-class IncidentList(_serialization.Model):
- """List all the incidents.
-
- 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 value: Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Incident]
- :ivar next_link: URL to fetch the next set of incidents.
- :vartype next_link: str
- """
-
- _validation = {
- "value": {"required": True},
- "next_link": {"readonly": True},
- }
-
- _attribute_map = {
- "value": {"key": "value", "type": "[Incident]"},
- "next_link": {"key": "nextLink", "type": "str"},
- }
-
- def __init__(self, *, value: List["_models.Incident"], **kwargs):
- """
- :keyword value: Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Incident]
- """
- super().__init__(**kwargs)
- self.value = value
- self.next_link = None
-
-
-class IncidentOwnerInfo(_serialization.Model):
- """Information on the user an incident is assigned to.
-
- :ivar email: The email of the user the incident is assigned to.
- :vartype email: str
- :ivar assigned_to: The name of the user the incident is assigned to.
- :vartype assigned_to: str
- :ivar object_id: The object id of the user the incident is assigned to.
- :vartype object_id: str
- :ivar user_principal_name: The user principal name of the user the incident is assigned to.
- :vartype user_principal_name: str
- :ivar owner_type: The type of the owner the incident is assigned to. Known values are:
- "Unknown", "User", and "Group".
- :vartype owner_type: str or ~azure.mgmt.securityinsight.models.OwnerType
- """
-
- _attribute_map = {
- "email": {"key": "email", "type": "str"},
- "assigned_to": {"key": "assignedTo", "type": "str"},
- "object_id": {"key": "objectId", "type": "str"},
- "user_principal_name": {"key": "userPrincipalName", "type": "str"},
- "owner_type": {"key": "ownerType", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- email: Optional[str] = None,
- assigned_to: Optional[str] = None,
- object_id: Optional[str] = None,
- user_principal_name: Optional[str] = None,
- owner_type: Optional[Union[str, "_models.OwnerType"]] = None,
- **kwargs
- ):
- """
- :keyword email: The email of the user the incident is assigned to.
- :paramtype email: str
- :keyword assigned_to: The name of the user the incident is assigned to.
- :paramtype assigned_to: str
- :keyword object_id: The object id of the user the incident is assigned to.
- :paramtype object_id: str
- :keyword user_principal_name: The user principal name of the user the incident is assigned to.
- :paramtype user_principal_name: str
- :keyword owner_type: The type of the owner the incident is assigned to. Known values are:
- "Unknown", "User", and "Group".
- :paramtype owner_type: str or ~azure.mgmt.securityinsight.models.OwnerType
- """
- super().__init__(**kwargs)
- self.email = email
- self.assigned_to = assigned_to
- self.object_id = object_id
- self.user_principal_name = user_principal_name
- self.owner_type = owner_type
-
-
-class IncidentPropertiesAction(_serialization.Model):
- """IncidentPropertiesAction.
-
- :ivar severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
- "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
- :ivar status: The status of the incident. Known values are: "New", "Active", and "Closed".
- :vartype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
- :ivar classification: The reason the incident was closed. Known values are: "Undetermined",
- "TruePositive", "BenignPositive", and "FalsePositive".
- :vartype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
- :ivar classification_reason: The classification reason the incident was closed with. Known
- values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
- "InaccurateData".
- :vartype classification_reason: str or
- ~azure.mgmt.securityinsight.models.IncidentClassificationReason
- :ivar classification_comment: Describes the reason the incident was closed.
- :vartype classification_comment: str
- :ivar owner: Information on the user an incident is assigned to.
- :vartype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
- :ivar labels: List of labels to add to the incident.
- :vartype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
- """
-
- _attribute_map = {
- "severity": {"key": "severity", "type": "str"},
- "status": {"key": "status", "type": "str"},
- "classification": {"key": "classification", "type": "str"},
- "classification_reason": {"key": "classificationReason", "type": "str"},
- "classification_comment": {"key": "classificationComment", "type": "str"},
- "owner": {"key": "owner", "type": "IncidentOwnerInfo"},
- "labels": {"key": "labels", "type": "[IncidentLabel]"},
- }
-
- def __init__(
- self,
- *,
- severity: Optional[Union[str, "_models.IncidentSeverity"]] = None,
- status: Optional[Union[str, "_models.IncidentStatus"]] = None,
- classification: Optional[Union[str, "_models.IncidentClassification"]] = None,
- classification_reason: Optional[Union[str, "_models.IncidentClassificationReason"]] = None,
- classification_comment: Optional[str] = None,
- owner: Optional["_models.IncidentOwnerInfo"] = None,
- labels: Optional[List["_models.IncidentLabel"]] = None,
- **kwargs
- ):
- """
- :keyword severity: The severity of the incident. Known values are: "High", "Medium", "Low", and
- "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.IncidentSeverity
- :keyword status: The status of the incident. Known values are: "New", "Active", and "Closed".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.IncidentStatus
- :keyword classification: The reason the incident was closed. Known values are: "Undetermined",
- "TruePositive", "BenignPositive", and "FalsePositive".
- :paramtype classification: str or ~azure.mgmt.securityinsight.models.IncidentClassification
- :keyword classification_reason: The classification reason the incident was closed with. Known
- values are: "SuspiciousActivity", "SuspiciousButExpected", "IncorrectAlertLogic", and
- "InaccurateData".
- :paramtype classification_reason: str or
- ~azure.mgmt.securityinsight.models.IncidentClassificationReason
- :keyword classification_comment: Describes the reason the incident was closed.
- :paramtype classification_comment: str
- :keyword owner: Information on the user an incident is assigned to.
- :paramtype owner: ~azure.mgmt.securityinsight.models.IncidentOwnerInfo
- :keyword labels: List of labels to add to the incident.
- :paramtype labels: list[~azure.mgmt.securityinsight.models.IncidentLabel]
- """
- super().__init__(**kwargs)
- self.severity = severity
- self.status = status
- self.classification = classification
- self.classification_reason = classification_reason
- self.classification_comment = classification_comment
- self.owner = owner
- self.labels = labels
-
-
-class IncidentTask(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """IncidentTask.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar title: The title of the task. Required.
- :vartype title: str
- :ivar description: The description of the task.
- :vartype description: str
- :ivar status: Required. Known values are: "New" and "Completed".
- :vartype status: str or ~azure.mgmt.securityinsight.models.IncidentTaskStatus
- :ivar created_time_utc: The time the task was created.
- :vartype created_time_utc: ~datetime.datetime
- :ivar last_modified_time_utc: The last time the task was updated.
- :vartype last_modified_time_utc: ~datetime.datetime
- :ivar created_by: Information on the client (user or application) that made some action.
- :vartype created_by: ~azure.mgmt.securityinsight.models.ClientInfo
- :ivar last_modified_by: Information on the client (user or application) that made some action.
- :vartype last_modified_by: ~azure.mgmt.securityinsight.models.ClientInfo
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "title": {"required": True},
- "status": {"required": True},
- "created_time_utc": {"readonly": True},
- "last_modified_time_utc": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "title": {"key": "properties.title", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "status": {"key": "properties.status", "type": "str"},
- "created_time_utc": {"key": "properties.createdTimeUtc", "type": "iso-8601"},
- "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
- "created_by": {"key": "properties.createdBy", "type": "ClientInfo"},
- "last_modified_by": {"key": "properties.lastModifiedBy", "type": "ClientInfo"},
- }
-
- def __init__(
- self,
- *,
- title: str,
- status: Union[str, "_models.IncidentTaskStatus"],
- etag: Optional[str] = None,
- description: Optional[str] = None,
- created_by: Optional["_models.ClientInfo"] = None,
- last_modified_by: Optional["_models.ClientInfo"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword title: The title of the task. Required.
- :paramtype title: str
- :keyword description: The description of the task.
- :paramtype description: str
- :keyword status: Required. Known values are: "New" and "Completed".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.IncidentTaskStatus
- :keyword created_by: Information on the client (user or application) that made some action.
- :paramtype created_by: ~azure.mgmt.securityinsight.models.ClientInfo
- :keyword last_modified_by: Information on the client (user or application) that made some
- action.
- :paramtype last_modified_by: ~azure.mgmt.securityinsight.models.ClientInfo
- """
- super().__init__(etag=etag, **kwargs)
- self.title = title
- self.description = description
- self.status = status
- self.created_time_utc = None
- self.last_modified_time_utc = None
- self.created_by = created_by
- self.last_modified_by = last_modified_by
-
-
-class IncidentTaskList(_serialization.Model):
- """IncidentTaskList.
-
- :ivar value:
- :vartype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
- :ivar next_link:
- :vartype next_link: str
- """
-
- _attribute_map = {
- "value": {"key": "value", "type": "[IncidentTask]"},
- "next_link": {"key": "nextLink", "type": "str"},
- }
-
- def __init__(
- self, *, value: Optional[List["_models.IncidentTask"]] = None, next_link: Optional[str] = None, **kwargs
- ):
- """
- :keyword value:
- :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
- :keyword next_link:
- :paramtype next_link: str
- """
- super().__init__(**kwargs)
- self.value = value
- self.next_link = next_link
-
-
-class InsightQueryItem(EntityQueryItem):
- """Represents Insight Query.
-
- 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: Query Template ARM ID.
- :vartype id: str
- :ivar name: Query Template ARM Name.
- :vartype name: str
- :ivar type: ARM Type.
- :vartype type: str
- :ivar kind: The kind of the entity query. Required. Known values are: "Expansion", "Insight",
- and "Activity".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryKind
- :ivar properties: Properties bag for InsightQueryItem.
- :vartype properties: ~azure.mgmt.securityinsight.models.InsightQueryItemProperties
- """
-
- _validation = {
- "id": {"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"},
- "properties": {"key": "properties", "type": "InsightQueryItemProperties"},
- }
-
- def __init__(
- self,
- *,
- name: Optional[str] = None,
- type: Optional[str] = None,
- properties: Optional["_models.InsightQueryItemProperties"] = None,
- **kwargs
- ):
- """
- :keyword name: Query Template ARM Name.
- :paramtype name: str
- :keyword type: ARM Type.
- :paramtype type: str
- :keyword properties: Properties bag for InsightQueryItem.
- :paramtype properties: ~azure.mgmt.securityinsight.models.InsightQueryItemProperties
- """
- super().__init__(name=name, type=type, **kwargs)
- self.kind: str = "Insight"
- self.properties = properties
-
-
-class InsightQueryItemProperties(EntityQueryItemProperties): # pylint: disable=too-many-instance-attributes
- """Represents Insight Query.
-
- :ivar data_types: Data types for template.
- :vartype data_types:
- list[~azure.mgmt.securityinsight.models.EntityQueryItemPropertiesDataTypesItem]
- :ivar input_entity_type: The type of the entity. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice", "SecurityAlert",
- "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :ivar required_input_fields_sets: Data types for template.
- :vartype required_input_fields_sets: list[list[str]]
- :ivar entities_filter: The query applied only to entities matching to all filters.
- :vartype entities_filter: JSON
- :ivar display_name: The insight display name.
- :vartype display_name: str
- :ivar description: The insight description.
- :vartype description: str
- :ivar base_query: The base query of the insight.
- :vartype base_query: str
- :ivar table_query: The insight table query.
- :vartype table_query: ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQuery
- :ivar chart_query: The insight chart query.
- :vartype chart_query: JSON
- :ivar additional_query: The activity query definitions.
- :vartype additional_query:
- ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesAdditionalQuery
- :ivar default_time_range: The insight chart query.
- :vartype default_time_range:
- ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesDefaultTimeRange
- :ivar reference_time_range: The insight chart query.
- :vartype reference_time_range:
- ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesReferenceTimeRange
- """
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "[EntityQueryItemPropertiesDataTypesItem]"},
- "input_entity_type": {"key": "inputEntityType", "type": "str"},
- "required_input_fields_sets": {"key": "requiredInputFieldsSets", "type": "[[str]]"},
- "entities_filter": {"key": "entitiesFilter", "type": "object"},
- "display_name": {"key": "displayName", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "base_query": {"key": "baseQuery", "type": "str"},
- "table_query": {"key": "tableQuery", "type": "InsightQueryItemPropertiesTableQuery"},
- "chart_query": {"key": "chartQuery", "type": "object"},
- "additional_query": {"key": "additionalQuery", "type": "InsightQueryItemPropertiesAdditionalQuery"},
- "default_time_range": {"key": "defaultTimeRange", "type": "InsightQueryItemPropertiesDefaultTimeRange"},
- "reference_time_range": {"key": "referenceTimeRange", "type": "InsightQueryItemPropertiesReferenceTimeRange"},
- }
-
- def __init__(
- self,
- *,
- data_types: Optional[List["_models.EntityQueryItemPropertiesDataTypesItem"]] = None,
- input_entity_type: Optional[Union[str, "_models.EntityType"]] = None,
- required_input_fields_sets: Optional[List[List[str]]] = None,
- entities_filter: Optional[JSON] = None,
- display_name: Optional[str] = None,
- description: Optional[str] = None,
- base_query: Optional[str] = None,
- table_query: Optional["_models.InsightQueryItemPropertiesTableQuery"] = None,
- chart_query: Optional[JSON] = None,
- additional_query: Optional["_models.InsightQueryItemPropertiesAdditionalQuery"] = None,
- default_time_range: Optional["_models.InsightQueryItemPropertiesDefaultTimeRange"] = None,
- reference_time_range: Optional["_models.InsightQueryItemPropertiesReferenceTimeRange"] = None,
- **kwargs
- ):
- """
- :keyword data_types: Data types for template.
- :paramtype data_types:
- list[~azure.mgmt.securityinsight.models.EntityQueryItemPropertiesDataTypesItem]
- :keyword input_entity_type: The type of the entity. Known values are: "Account", "Host",
- "File", "AzureResource", "CloudApplication", "DNS", "FileHash", "IP", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "URL", "IoTDevice", "SecurityAlert",
- "HuntingBookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :paramtype input_entity_type: str or ~azure.mgmt.securityinsight.models.EntityType
- :keyword required_input_fields_sets: Data types for template.
- :paramtype required_input_fields_sets: list[list[str]]
- :keyword entities_filter: The query applied only to entities matching to all filters.
- :paramtype entities_filter: JSON
- :keyword display_name: The insight display name.
- :paramtype display_name: str
- :keyword description: The insight description.
- :paramtype description: str
- :keyword base_query: The base query of the insight.
- :paramtype base_query: str
- :keyword table_query: The insight table query.
- :paramtype table_query: ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQuery
- :keyword chart_query: The insight chart query.
- :paramtype chart_query: JSON
- :keyword additional_query: The activity query definitions.
- :paramtype additional_query:
- ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesAdditionalQuery
- :keyword default_time_range: The insight chart query.
- :paramtype default_time_range:
- ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesDefaultTimeRange
- :keyword reference_time_range: The insight chart query.
- :paramtype reference_time_range:
- ~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesReferenceTimeRange
- """
- super().__init__(
- data_types=data_types,
- input_entity_type=input_entity_type,
- required_input_fields_sets=required_input_fields_sets,
- entities_filter=entities_filter,
- **kwargs
- )
- self.display_name = display_name
- self.description = description
- self.base_query = base_query
- self.table_query = table_query
- self.chart_query = chart_query
- self.additional_query = additional_query
- self.default_time_range = default_time_range
- self.reference_time_range = reference_time_range
-
-
-class InsightQueryItemPropertiesAdditionalQuery(_serialization.Model):
- """The activity query definitions.
-
- :ivar query: The insight query.
- :vartype query: str
- :ivar text: The insight text.
- :vartype text: str
- """
-
- _attribute_map = {
- "query": {"key": "query", "type": "str"},
- "text": {"key": "text", "type": "str"},
- }
-
- def __init__(self, *, query: Optional[str] = None, text: Optional[str] = None, **kwargs):
- """
- :keyword query: The insight query.
- :paramtype query: str
- :keyword text: The insight text.
- :paramtype text: str
- """
- super().__init__(**kwargs)
- self.query = query
- self.text = text
-
-
-class InsightQueryItemPropertiesDefaultTimeRange(_serialization.Model):
- """The insight chart query.
-
- :ivar before_range: The padding for the start time of the query.
- :vartype before_range: str
- :ivar after_range: The padding for the end time of the query.
- :vartype after_range: str
- """
-
- _attribute_map = {
- "before_range": {"key": "beforeRange", "type": "str"},
- "after_range": {"key": "afterRange", "type": "str"},
- }
-
- def __init__(self, *, before_range: Optional[str] = None, after_range: Optional[str] = None, **kwargs):
- """
- :keyword before_range: The padding for the start time of the query.
- :paramtype before_range: str
- :keyword after_range: The padding for the end time of the query.
- :paramtype after_range: str
- """
- super().__init__(**kwargs)
- self.before_range = before_range
- self.after_range = after_range
-
-
-class InsightQueryItemPropertiesReferenceTimeRange(_serialization.Model):
- """The insight chart query.
-
- :ivar before_range: Additional query time for looking back.
- :vartype before_range: str
- """
-
- _attribute_map = {
- "before_range": {"key": "beforeRange", "type": "str"},
- }
-
- def __init__(self, *, before_range: Optional[str] = None, **kwargs):
- """
- :keyword before_range: Additional query time for looking back.
- :paramtype before_range: str
- """
- super().__init__(**kwargs)
- self.before_range = before_range
-
-
-class InsightQueryItemPropertiesTableQuery(_serialization.Model):
- """The insight table query.
-
- :ivar columns_definitions: List of insight column definitions.
- :vartype columns_definitions:
- list[~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem]
- :ivar queries_definitions: List of insight queries definitions.
- :vartype queries_definitions:
- list[~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem]
- """
-
- _attribute_map = {
- "columns_definitions": {
- "key": "columnsDefinitions",
- "type": "[InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem]",
- },
- "queries_definitions": {
- "key": "queriesDefinitions",
- "type": "[InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem]",
- },
- }
-
- def __init__(
- self,
- *,
- columns_definitions: Optional[
- List["_models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem"]
- ] = None,
- queries_definitions: Optional[
- List["_models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem"]
- ] = None,
- **kwargs
- ):
- """
- :keyword columns_definitions: List of insight column definitions.
- :paramtype columns_definitions:
- list[~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem]
- :keyword queries_definitions: List of insight queries definitions.
- :paramtype queries_definitions:
- list[~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem]
- """
- super().__init__(**kwargs)
- self.columns_definitions = columns_definitions
- self.queries_definitions = queries_definitions
-
-
-class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem(_serialization.Model):
- """InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.
-
- :ivar header: Insight column header.
- :vartype header: str
- :ivar output_type: Insights Column type. Known values are: "Number", "String", "Date", and
- "Entity".
- :vartype output_type: str or ~azure.mgmt.securityinsight.models.OutputType
- :ivar support_deep_link: Is query supports deep-link.
- :vartype support_deep_link: bool
- """
-
- _attribute_map = {
- "header": {"key": "header", "type": "str"},
- "output_type": {"key": "outputType", "type": "str"},
- "support_deep_link": {"key": "supportDeepLink", "type": "bool"},
- }
-
- def __init__(
- self,
- *,
- header: Optional[str] = None,
- output_type: Optional[Union[str, "_models.OutputType"]] = None,
- support_deep_link: Optional[bool] = None,
- **kwargs
- ):
- """
- :keyword header: Insight column header.
- :paramtype header: str
- :keyword output_type: Insights Column type. Known values are: "Number", "String", "Date", and
- "Entity".
- :paramtype output_type: str or ~azure.mgmt.securityinsight.models.OutputType
- :keyword support_deep_link: Is query supports deep-link.
- :paramtype support_deep_link: bool
- """
- super().__init__(**kwargs)
- self.header = header
- self.output_type = output_type
- self.support_deep_link = support_deep_link
-
-
-class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem(_serialization.Model):
- """InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.
-
- :ivar filter: Insight column header.
- :vartype filter: str
- :ivar summarize: Insight column header.
- :vartype summarize: str
- :ivar project: Insight column header.
- :vartype project: str
- :ivar link_columns_definitions: Insight column header.
- :vartype link_columns_definitions:
- list[~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem]
- """
-
- _attribute_map = {
- "filter": {"key": "filter", "type": "str"},
- "summarize": {"key": "summarize", "type": "str"},
- "project": {"key": "project", "type": "str"},
- "link_columns_definitions": {
- "key": "linkColumnsDefinitions",
- "type": "[InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem]",
- },
- }
-
- def __init__(
- self,
- *,
- filter: Optional[str] = None, # pylint: disable=redefined-builtin
- summarize: Optional[str] = None,
- project: Optional[str] = None,
- link_columns_definitions: Optional[
- List["_models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem"]
- ] = None,
- **kwargs
- ):
- """
- :keyword filter: Insight column header.
- :paramtype filter: str
- :keyword summarize: Insight column header.
- :paramtype summarize: str
- :keyword project: Insight column header.
- :paramtype project: str
- :keyword link_columns_definitions: Insight column header.
- :paramtype link_columns_definitions:
- list[~azure.mgmt.securityinsight.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem]
- """
- super().__init__(**kwargs)
- self.filter = filter
- self.summarize = summarize
- self.project = project
- self.link_columns_definitions = link_columns_definitions
-
-
-class InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem(_serialization.Model):
- """InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.
-
- :ivar projected_name: Insight Link Definition Projected Name.
- :vartype projected_name: str
- :ivar query: Insight Link Definition Query.
- :vartype query: str
- """
-
- _attribute_map = {
- "projected_name": {"key": "projectedName", "type": "str"},
- "query": {"key": "Query", "type": "str"},
- }
-
- def __init__(self, *, projected_name: Optional[str] = None, query: Optional[str] = None, **kwargs):
- """
- :keyword projected_name: Insight Link Definition Projected Name.
- :paramtype projected_name: str
- :keyword query: Insight Link Definition Query.
- :paramtype query: str
- """
- super().__init__(**kwargs)
- self.projected_name = projected_name
- self.query = query
-
-
-class InsightsTableResult(_serialization.Model):
- """Query results for table insights query.
-
- :ivar columns: Columns Metadata of the table.
- :vartype columns: list[~azure.mgmt.securityinsight.models.InsightsTableResultColumnsItem]
- :ivar rows: Rows data of the table.
- :vartype rows: list[list[str]]
- """
-
- _attribute_map = {
- "columns": {"key": "columns", "type": "[InsightsTableResultColumnsItem]"},
- "rows": {"key": "rows", "type": "[[str]]"},
- }
-
- def __init__(
- self,
- *,
- columns: Optional[List["_models.InsightsTableResultColumnsItem"]] = None,
- rows: Optional[List[List[str]]] = None,
- **kwargs
- ):
- """
- :keyword columns: Columns Metadata of the table.
- :paramtype columns: list[~azure.mgmt.securityinsight.models.InsightsTableResultColumnsItem]
- :keyword rows: Rows data of the table.
- :paramtype rows: list[list[str]]
- """
- super().__init__(**kwargs)
- self.columns = columns
- self.rows = rows
-
-
-class InsightsTableResultColumnsItem(_serialization.Model):
- """InsightsTableResultColumnsItem.
-
- :ivar type: the type of the colum.
- :vartype type: str
- :ivar name: the name of the colum.
- :vartype name: str
- """
-
- _attribute_map = {
- "type": {"key": "type", "type": "str"},
- "name": {"key": "name", "type": "str"},
- }
-
- def __init__(self, *, type: Optional[str] = None, name: Optional[str] = None, **kwargs):
- """
- :keyword type: the type of the colum.
- :paramtype type: str
- :keyword name: the name of the colum.
- :paramtype name: str
- """
- super().__init__(**kwargs)
- self.type = type
- self.name = name
-
-
-class Instructions(_serialization.Model):
- """Instructions section of a recommendation.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar actions_to_be_performed: What actions should be taken to complete the recommendation.
- Required.
- :vartype actions_to_be_performed: str
- :ivar recommendation_importance: Explains why the recommendation is important. Required.
- :vartype recommendation_importance: str
- :ivar how_to_perform_action_details: How should the user complete the recommendation.
- :vartype how_to_perform_action_details: str
- """
-
- _validation = {
- "actions_to_be_performed": {"required": True},
- "recommendation_importance": {"required": True},
- }
-
- _attribute_map = {
- "actions_to_be_performed": {"key": "actionsToBePerformed", "type": "str"},
- "recommendation_importance": {"key": "recommendationImportance", "type": "str"},
- "how_to_perform_action_details": {"key": "howToPerformActionDetails", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- actions_to_be_performed: str,
- recommendation_importance: str,
- how_to_perform_action_details: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword actions_to_be_performed: What actions should be taken to complete the recommendation.
- Required.
- :paramtype actions_to_be_performed: str
- :keyword recommendation_importance: Explains why the recommendation is important. Required.
- :paramtype recommendation_importance: str
- :keyword how_to_perform_action_details: How should the user complete the recommendation.
- :paramtype how_to_perform_action_details: str
- """
- super().__init__(**kwargs)
- self.actions_to_be_performed = actions_to_be_performed
- self.recommendation_importance = recommendation_importance
- self.how_to_perform_action_details = how_to_perform_action_details
-
-
-class InstructionStepsInstructionsItem(ConnectorInstructionModelBase):
- """InstructionStepsInstructionsItem.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar parameters: The parameters for the setting.
- :vartype parameters: JSON
- :ivar type: The kind of the setting. Required. Known values are: "CopyableLabel",
- "InstructionStepsGroup", and "InfoMessage".
- :vartype type: str or ~azure.mgmt.securityinsight.models.SettingType
- """
-
- _validation = {
- "type": {"required": True},
- }
-
- _attribute_map = {
- "parameters": {"key": "parameters", "type": "object"},
- "type": {"key": "type", "type": "str"},
- }
-
- def __init__(self, *, type: Union[str, "_models.SettingType"], parameters: Optional[JSON] = None, **kwargs):
- """
- :keyword parameters: The parameters for the setting.
- :paramtype parameters: JSON
- :keyword type: The kind of the setting. Required. Known values are: "CopyableLabel",
- "InstructionStepsGroup", and "InfoMessage".
- :paramtype type: str or ~azure.mgmt.securityinsight.models.SettingType
- """
- super().__init__(parameters=parameters, type=type, **kwargs)
-
-
-class IoTCheckRequirements(DataConnectorsCheckRequirements):
- """Represents IoT requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar subscription_id: The subscription id to connect to, and get the data from.
- :vartype subscription_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
- }
-
- def __init__(self, *, subscription_id: Optional[str] = None, **kwargs):
- """
- :keyword subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "IOT"
- self.subscription_id = subscription_id
-
-
-class IoTDataConnector(DataConnector):
- """Represents IoT 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar subscription_id: The subscription id to connect to, and get the data from.
- :vartype subscription_id: str
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- subscription_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "IOT"
- self.data_types = data_types
- self.subscription_id = subscription_id
-
-
-class IoTDataConnectorProperties(DataConnectorWithAlertsProperties):
- """IoT data connector properties.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar subscription_id: The subscription id to connect to, and get the data from.
- :vartype subscription_id: str
- """
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "subscription_id": {"key": "subscriptionId", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- subscription_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
- """
- super().__init__(data_types=data_types, **kwargs)
- self.subscription_id = subscription_id
-
-
-class IoTDeviceEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents an IoT device entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar device_id: The ID of the IoT Device in the IoT Hub.
- :vartype device_id: str
- :ivar device_name: The friendly name of the device.
- :vartype device_name: str
- :ivar source: The source of the device.
- :vartype source: str
- :ivar iot_security_agent_id: The ID of the security agent running on the device.
- :vartype iot_security_agent_id: str
- :ivar device_type: The type of the device.
- :vartype device_type: str
- :ivar vendor: The vendor of the device.
- :vartype vendor: str
- :ivar edge_id: The ID of the edge device.
- :vartype edge_id: str
- :ivar mac_address: The MAC address of the device.
- :vartype mac_address: str
- :ivar model: The model of the device.
- :vartype model: str
- :ivar serial_number: The serial number of the device.
- :vartype serial_number: str
- :ivar firmware_version: The firmware version of the device.
- :vartype firmware_version: str
- :ivar operating_system: The operating system of the device.
- :vartype operating_system: str
- :ivar iot_hub_entity_id: The AzureResource entity id of the IoT Hub.
- :vartype iot_hub_entity_id: str
- :ivar host_entity_id: The Host entity id of this device.
- :vartype host_entity_id: str
- :ivar ip_address_entity_id: The IP entity if of this device.
- :vartype ip_address_entity_id: str
- :ivar threat_intelligence: A list of TI contexts attached to the IoTDevice entity.
- :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
- :ivar protocols: A list of protocols of the IoTDevice entity.
- :vartype protocols: list[str]
- :ivar owners: A list of owners of the IoTDevice entity.
- :vartype owners: list[str]
- :ivar nic_entity_ids: A list of Nic entity ids of the IoTDevice entity.
- :vartype nic_entity_ids: list[str]
- :ivar site: The site of the device.
- :vartype site: str
- :ivar zone: The zone location of the device within a site.
- :vartype zone: str
- :ivar sensor: The sensor the device is monitored by.
- :vartype sensor: str
- :ivar device_sub_type: The subType of the device ('PLC', 'HMI', 'EWS', etc.).
- :vartype device_sub_type: str
- :ivar importance: Device importance, determines if the device classified as 'crown jewel'.
- Known values are: "Unknown", "Low", "Normal", and "High".
- :vartype importance: str or ~azure.mgmt.securityinsight.models.DeviceImportance
- :ivar purdue_layer: The Purdue Layer of the device.
- :vartype purdue_layer: str
- :ivar is_authorized: Determines whether the device classified as authorized device.
- :vartype is_authorized: bool
- :ivar is_programming: Determines whether the device classified as programming device.
- :vartype is_programming: bool
- :ivar is_scanner: Is the device classified as a scanner device.
- :vartype is_scanner: bool
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "device_id": {"readonly": True},
- "device_name": {"readonly": True},
- "source": {"readonly": True},
- "iot_security_agent_id": {"readonly": True},
- "device_type": {"readonly": True},
- "vendor": {"readonly": True},
- "edge_id": {"readonly": True},
- "mac_address": {"readonly": True},
- "model": {"readonly": True},
- "serial_number": {"readonly": True},
- "firmware_version": {"readonly": True},
- "operating_system": {"readonly": True},
- "iot_hub_entity_id": {"readonly": True},
- "host_entity_id": {"readonly": True},
- "ip_address_entity_id": {"readonly": True},
- "threat_intelligence": {"readonly": True},
- "protocols": {"readonly": True},
- "owners": {"readonly": True},
- "nic_entity_ids": {"readonly": True},
- "site": {"readonly": True},
- "zone": {"readonly": True},
- "sensor": {"readonly": True},
- "device_sub_type": {"readonly": True},
- "purdue_layer": {"readonly": True},
- "is_authorized": {"readonly": True},
- "is_programming": {"readonly": True},
- "is_scanner": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "device_id": {"key": "properties.deviceId", "type": "str"},
- "device_name": {"key": "properties.deviceName", "type": "str"},
- "source": {"key": "properties.source", "type": "str"},
- "iot_security_agent_id": {"key": "properties.iotSecurityAgentId", "type": "str"},
- "device_type": {"key": "properties.deviceType", "type": "str"},
- "vendor": {"key": "properties.vendor", "type": "str"},
- "edge_id": {"key": "properties.edgeId", "type": "str"},
- "mac_address": {"key": "properties.macAddress", "type": "str"},
- "model": {"key": "properties.model", "type": "str"},
- "serial_number": {"key": "properties.serialNumber", "type": "str"},
- "firmware_version": {"key": "properties.firmwareVersion", "type": "str"},
- "operating_system": {"key": "properties.operatingSystem", "type": "str"},
- "iot_hub_entity_id": {"key": "properties.iotHubEntityId", "type": "str"},
- "host_entity_id": {"key": "properties.hostEntityId", "type": "str"},
- "ip_address_entity_id": {"key": "properties.ipAddressEntityId", "type": "str"},
- "threat_intelligence": {"key": "properties.threatIntelligence", "type": "[ThreatIntelligence]"},
- "protocols": {"key": "properties.protocols", "type": "[str]"},
- "owners": {"key": "properties.owners", "type": "[str]"},
- "nic_entity_ids": {"key": "properties.nicEntityIds", "type": "[str]"},
- "site": {"key": "properties.site", "type": "str"},
- "zone": {"key": "properties.zone", "type": "str"},
- "sensor": {"key": "properties.sensor", "type": "str"},
- "device_sub_type": {"key": "properties.deviceSubType", "type": "str"},
- "importance": {"key": "properties.importance", "type": "str"},
- "purdue_layer": {"key": "properties.purdueLayer", "type": "str"},
- "is_authorized": {"key": "properties.isAuthorized", "type": "bool"},
- "is_programming": {"key": "properties.isProgramming", "type": "bool"},
- "is_scanner": {"key": "properties.isScanner", "type": "bool"},
- }
-
- def __init__( # pylint: disable=too-many-locals
- self, *, importance: Optional[Union[str, "_models.DeviceImportance"]] = None, **kwargs
- ):
- """
- :keyword importance: Device importance, determines if the device classified as 'crown jewel'.
- Known values are: "Unknown", "Low", "Normal", and "High".
- :paramtype importance: str or ~azure.mgmt.securityinsight.models.DeviceImportance
- """
- super().__init__(**kwargs)
- self.kind: str = "IoTDevice"
- self.additional_data = None
- self.friendly_name = None
- self.device_id = None
- self.device_name = None
- self.source = None
- self.iot_security_agent_id = None
- self.device_type = None
- self.vendor = None
- self.edge_id = None
- self.mac_address = None
- self.model = None
- self.serial_number = None
- self.firmware_version = None
- self.operating_system = None
- self.iot_hub_entity_id = None
- self.host_entity_id = None
- self.ip_address_entity_id = None
- self.threat_intelligence = None
- self.protocols = None
- self.owners = None
- self.nic_entity_ids = None
- self.site = None
- self.zone = None
- self.sensor = None
- self.device_sub_type = None
- self.importance = importance
- self.purdue_layer = None
- self.is_authorized = None
- self.is_programming = None
- self.is_scanner = None
-
-
-class IoTDeviceEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """IoTDevice entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar device_id: The ID of the IoT Device in the IoT Hub.
- :vartype device_id: str
- :ivar device_name: The friendly name of the device.
- :vartype device_name: str
- :ivar source: The source of the device.
- :vartype source: str
- :ivar iot_security_agent_id: The ID of the security agent running on the device.
- :vartype iot_security_agent_id: str
- :ivar device_type: The type of the device.
- :vartype device_type: str
- :ivar vendor: The vendor of the device.
- :vartype vendor: str
- :ivar edge_id: The ID of the edge device.
- :vartype edge_id: str
- :ivar mac_address: The MAC address of the device.
- :vartype mac_address: str
- :ivar model: The model of the device.
- :vartype model: str
- :ivar serial_number: The serial number of the device.
- :vartype serial_number: str
- :ivar firmware_version: The firmware version of the device.
- :vartype firmware_version: str
- :ivar operating_system: The operating system of the device.
- :vartype operating_system: str
- :ivar iot_hub_entity_id: The AzureResource entity id of the IoT Hub.
- :vartype iot_hub_entity_id: str
- :ivar host_entity_id: The Host entity id of this device.
- :vartype host_entity_id: str
- :ivar ip_address_entity_id: The IP entity if of this device.
- :vartype ip_address_entity_id: str
- :ivar threat_intelligence: A list of TI contexts attached to the IoTDevice entity.
- :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
- :ivar protocols: A list of protocols of the IoTDevice entity.
- :vartype protocols: list[str]
- :ivar owners: A list of owners of the IoTDevice entity.
- :vartype owners: list[str]
- :ivar nic_entity_ids: A list of Nic entity ids of the IoTDevice entity.
- :vartype nic_entity_ids: list[str]
- :ivar site: The site of the device.
- :vartype site: str
- :ivar zone: The zone location of the device within a site.
- :vartype zone: str
- :ivar sensor: The sensor the device is monitored by.
- :vartype sensor: str
- :ivar device_sub_type: The subType of the device ('PLC', 'HMI', 'EWS', etc.).
- :vartype device_sub_type: str
- :ivar importance: Device importance, determines if the device classified as 'crown jewel'.
- Known values are: "Unknown", "Low", "Normal", and "High".
- :vartype importance: str or ~azure.mgmt.securityinsight.models.DeviceImportance
- :ivar purdue_layer: The Purdue Layer of the device.
- :vartype purdue_layer: str
- :ivar is_authorized: Determines whether the device classified as authorized device.
- :vartype is_authorized: bool
- :ivar is_programming: Determines whether the device classified as programming device.
- :vartype is_programming: bool
- :ivar is_scanner: Is the device classified as a scanner device.
- :vartype is_scanner: bool
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "device_id": {"readonly": True},
- "device_name": {"readonly": True},
- "source": {"readonly": True},
- "iot_security_agent_id": {"readonly": True},
- "device_type": {"readonly": True},
- "vendor": {"readonly": True},
- "edge_id": {"readonly": True},
- "mac_address": {"readonly": True},
- "model": {"readonly": True},
- "serial_number": {"readonly": True},
- "firmware_version": {"readonly": True},
- "operating_system": {"readonly": True},
- "iot_hub_entity_id": {"readonly": True},
- "host_entity_id": {"readonly": True},
- "ip_address_entity_id": {"readonly": True},
- "threat_intelligence": {"readonly": True},
- "protocols": {"readonly": True},
- "owners": {"readonly": True},
- "nic_entity_ids": {"readonly": True},
- "site": {"readonly": True},
- "zone": {"readonly": True},
- "sensor": {"readonly": True},
- "device_sub_type": {"readonly": True},
- "purdue_layer": {"readonly": True},
- "is_authorized": {"readonly": True},
- "is_programming": {"readonly": True},
- "is_scanner": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "device_id": {"key": "deviceId", "type": "str"},
- "device_name": {"key": "deviceName", "type": "str"},
- "source": {"key": "source", "type": "str"},
- "iot_security_agent_id": {"key": "iotSecurityAgentId", "type": "str"},
- "device_type": {"key": "deviceType", "type": "str"},
- "vendor": {"key": "vendor", "type": "str"},
- "edge_id": {"key": "edgeId", "type": "str"},
- "mac_address": {"key": "macAddress", "type": "str"},
- "model": {"key": "model", "type": "str"},
- "serial_number": {"key": "serialNumber", "type": "str"},
- "firmware_version": {"key": "firmwareVersion", "type": "str"},
- "operating_system": {"key": "operatingSystem", "type": "str"},
- "iot_hub_entity_id": {"key": "iotHubEntityId", "type": "str"},
- "host_entity_id": {"key": "hostEntityId", "type": "str"},
- "ip_address_entity_id": {"key": "ipAddressEntityId", "type": "str"},
- "threat_intelligence": {"key": "threatIntelligence", "type": "[ThreatIntelligence]"},
- "protocols": {"key": "protocols", "type": "[str]"},
- "owners": {"key": "owners", "type": "[str]"},
- "nic_entity_ids": {"key": "nicEntityIds", "type": "[str]"},
- "site": {"key": "site", "type": "str"},
- "zone": {"key": "zone", "type": "str"},
- "sensor": {"key": "sensor", "type": "str"},
- "device_sub_type": {"key": "deviceSubType", "type": "str"},
- "importance": {"key": "importance", "type": "str"},
- "purdue_layer": {"key": "purdueLayer", "type": "str"},
- "is_authorized": {"key": "isAuthorized", "type": "bool"},
- "is_programming": {"key": "isProgramming", "type": "bool"},
- "is_scanner": {"key": "isScanner", "type": "bool"},
- }
-
- def __init__( # pylint: disable=too-many-locals
- self, *, importance: Optional[Union[str, "_models.DeviceImportance"]] = None, **kwargs
- ):
- """
- :keyword importance: Device importance, determines if the device classified as 'crown jewel'.
- Known values are: "Unknown", "Low", "Normal", and "High".
- :paramtype importance: str or ~azure.mgmt.securityinsight.models.DeviceImportance
- """
- super().__init__(**kwargs)
- self.device_id = None
- self.device_name = None
- self.source = None
- self.iot_security_agent_id = None
- self.device_type = None
- self.vendor = None
- self.edge_id = None
- self.mac_address = None
- self.model = None
- self.serial_number = None
- self.firmware_version = None
- self.operating_system = None
- self.iot_hub_entity_id = None
- self.host_entity_id = None
- self.ip_address_entity_id = None
- self.threat_intelligence = None
- self.protocols = None
- self.owners = None
- self.nic_entity_ids = None
- self.site = None
- self.zone = None
- self.sensor = None
- self.device_sub_type = None
- self.importance = importance
- self.purdue_layer = None
- self.is_authorized = None
- self.is_programming = None
- self.is_scanner = None
-
-
-class IpEntity(Entity):
- """Represents an ip entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar address: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6).
- :vartype address: str
- :ivar location: The geo-location context attached to the ip entity.
- :vartype location: ~azure.mgmt.securityinsight.models.GeoLocation
- :ivar threat_intelligence: A list of TI contexts attached to the ip entity.
- :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "address": {"readonly": True},
- "location": {"readonly": True},
- "threat_intelligence": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "address": {"key": "properties.address", "type": "str"},
- "location": {"key": "properties.location", "type": "GeoLocation"},
- "threat_intelligence": {"key": "properties.threatIntelligence", "type": "[ThreatIntelligence]"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "Ip"
- self.additional_data = None
- self.friendly_name = None
- self.address = None
- self.location = None
- self.threat_intelligence = None
-
-
-class IpEntityProperties(EntityCommonProperties):
- """Ip entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar address: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6).
- :vartype address: str
- :ivar location: The geo-location context attached to the ip entity.
- :vartype location: ~azure.mgmt.securityinsight.models.GeoLocation
- :ivar threat_intelligence: A list of TI contexts attached to the ip entity.
- :vartype threat_intelligence: list[~azure.mgmt.securityinsight.models.ThreatIntelligence]
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "address": {"readonly": True},
- "location": {"readonly": True},
- "threat_intelligence": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "address": {"key": "address", "type": "str"},
- "location": {"key": "location", "type": "GeoLocation"},
- "threat_intelligence": {"key": "threatIntelligence", "type": "[ThreatIntelligence]"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.address = None
- self.location = None
- self.threat_intelligence = None
-
-
-class MailboxEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a mailbox entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar mailbox_primary_address: The mailbox's primary address.
- :vartype mailbox_primary_address: str
- :ivar display_name: The mailbox's display name.
- :vartype display_name: str
- :ivar upn: The mailbox's UPN.
- :vartype upn: str
- :ivar external_directory_object_id: The AzureAD identifier of mailbox. Similar to AadUserId in
- account entity but this property is specific to mailbox object on office side.
- :vartype external_directory_object_id: str
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "mailbox_primary_address": {"readonly": True},
- "display_name": {"readonly": True},
- "upn": {"readonly": True},
- "external_directory_object_id": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "mailbox_primary_address": {"key": "properties.mailboxPrimaryAddress", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "upn": {"key": "properties.upn", "type": "str"},
- "external_directory_object_id": {"key": "properties.externalDirectoryObjectId", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "Mailbox"
- self.additional_data = None
- self.friendly_name = None
- self.mailbox_primary_address = None
- self.display_name = None
- self.upn = None
- self.external_directory_object_id = None
-
-
-class MailboxEntityProperties(EntityCommonProperties):
- """Mailbox entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar mailbox_primary_address: The mailbox's primary address.
- :vartype mailbox_primary_address: str
- :ivar display_name: The mailbox's display name.
- :vartype display_name: str
- :ivar upn: The mailbox's UPN.
- :vartype upn: str
- :ivar external_directory_object_id: The AzureAD identifier of mailbox. Similar to AadUserId in
- account entity but this property is specific to mailbox object on office side.
- :vartype external_directory_object_id: str
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "mailbox_primary_address": {"readonly": True},
- "display_name": {"readonly": True},
- "upn": {"readonly": True},
- "external_directory_object_id": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "mailbox_primary_address": {"key": "mailboxPrimaryAddress", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "upn": {"key": "upn", "type": "str"},
- "external_directory_object_id": {"key": "externalDirectoryObjectId", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.mailbox_primary_address = None
- self.display_name = None
- self.upn = None
- self.external_directory_object_id = None
-
-
-class MailClusterEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a mail cluster entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar network_message_ids: The mail message IDs that are part of the mail cluster.
- :vartype network_message_ids: list[str]
- :ivar count_by_delivery_status: Count of mail messages by DeliveryStatus string representation.
- :vartype count_by_delivery_status: JSON
- :ivar count_by_threat_type: Count of mail messages by ThreatType string representation.
- :vartype count_by_threat_type: JSON
- :ivar count_by_protection_status: Count of mail messages by ProtectionStatus string
- representation.
- :vartype count_by_protection_status: JSON
- :ivar threats: The threats of mail messages that are part of the mail cluster.
- :vartype threats: list[str]
- :ivar query: The query that was used to identify the messages of the mail cluster.
- :vartype query: str
- :ivar query_time: The query time.
- :vartype query_time: ~datetime.datetime
- :ivar mail_count: The number of mail messages that are part of the mail cluster.
- :vartype mail_count: int
- :ivar is_volume_anomaly: Is this a volume anomaly mail cluster.
- :vartype is_volume_anomaly: bool
- :ivar source: The source of the mail cluster (default is 'O365 ATP').
- :vartype source: str
- :ivar cluster_source_identifier: The id of the cluster source.
- :vartype cluster_source_identifier: str
- :ivar cluster_source_type: The type of the cluster source.
- :vartype cluster_source_type: str
- :ivar cluster_query_start_time: The cluster query start time.
- :vartype cluster_query_start_time: ~datetime.datetime
- :ivar cluster_query_end_time: The cluster query end time.
- :vartype cluster_query_end_time: ~datetime.datetime
- :ivar cluster_group: The cluster group.
- :vartype cluster_group: str
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "network_message_ids": {"readonly": True},
- "count_by_delivery_status": {"readonly": True},
- "count_by_threat_type": {"readonly": True},
- "count_by_protection_status": {"readonly": True},
- "threats": {"readonly": True},
- "query": {"readonly": True},
- "query_time": {"readonly": True},
- "mail_count": {"readonly": True},
- "is_volume_anomaly": {"readonly": True},
- "source": {"readonly": True},
- "cluster_source_identifier": {"readonly": True},
- "cluster_source_type": {"readonly": True},
- "cluster_query_start_time": {"readonly": True},
- "cluster_query_end_time": {"readonly": True},
- "cluster_group": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "network_message_ids": {"key": "properties.networkMessageIds", "type": "[str]"},
- "count_by_delivery_status": {"key": "properties.countByDeliveryStatus", "type": "object"},
- "count_by_threat_type": {"key": "properties.countByThreatType", "type": "object"},
- "count_by_protection_status": {"key": "properties.countByProtectionStatus", "type": "object"},
- "threats": {"key": "properties.threats", "type": "[str]"},
- "query": {"key": "properties.query", "type": "str"},
- "query_time": {"key": "properties.queryTime", "type": "iso-8601"},
- "mail_count": {"key": "properties.mailCount", "type": "int"},
- "is_volume_anomaly": {"key": "properties.isVolumeAnomaly", "type": "bool"},
- "source": {"key": "properties.source", "type": "str"},
- "cluster_source_identifier": {"key": "properties.clusterSourceIdentifier", "type": "str"},
- "cluster_source_type": {"key": "properties.clusterSourceType", "type": "str"},
- "cluster_query_start_time": {"key": "properties.clusterQueryStartTime", "type": "iso-8601"},
- "cluster_query_end_time": {"key": "properties.clusterQueryEndTime", "type": "iso-8601"},
- "cluster_group": {"key": "properties.clusterGroup", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "MailCluster"
- self.additional_data = None
- self.friendly_name = None
- self.network_message_ids = None
- self.count_by_delivery_status = None
- self.count_by_threat_type = None
- self.count_by_protection_status = None
- self.threats = None
- self.query = None
- self.query_time = None
- self.mail_count = None
- self.is_volume_anomaly = None
- self.source = None
- self.cluster_source_identifier = None
- self.cluster_source_type = None
- self.cluster_query_start_time = None
- self.cluster_query_end_time = None
- self.cluster_group = None
-
-
-class MailClusterEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Mail cluster entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar network_message_ids: The mail message IDs that are part of the mail cluster.
- :vartype network_message_ids: list[str]
- :ivar count_by_delivery_status: Count of mail messages by DeliveryStatus string representation.
- :vartype count_by_delivery_status: JSON
- :ivar count_by_threat_type: Count of mail messages by ThreatType string representation.
- :vartype count_by_threat_type: JSON
- :ivar count_by_protection_status: Count of mail messages by ProtectionStatus string
- representation.
- :vartype count_by_protection_status: JSON
- :ivar threats: The threats of mail messages that are part of the mail cluster.
- :vartype threats: list[str]
- :ivar query: The query that was used to identify the messages of the mail cluster.
- :vartype query: str
- :ivar query_time: The query time.
- :vartype query_time: ~datetime.datetime
- :ivar mail_count: The number of mail messages that are part of the mail cluster.
- :vartype mail_count: int
- :ivar is_volume_anomaly: Is this a volume anomaly mail cluster.
- :vartype is_volume_anomaly: bool
- :ivar source: The source of the mail cluster (default is 'O365 ATP').
- :vartype source: str
- :ivar cluster_source_identifier: The id of the cluster source.
- :vartype cluster_source_identifier: str
- :ivar cluster_source_type: The type of the cluster source.
- :vartype cluster_source_type: str
- :ivar cluster_query_start_time: The cluster query start time.
- :vartype cluster_query_start_time: ~datetime.datetime
- :ivar cluster_query_end_time: The cluster query end time.
- :vartype cluster_query_end_time: ~datetime.datetime
- :ivar cluster_group: The cluster group.
- :vartype cluster_group: str
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "network_message_ids": {"readonly": True},
- "count_by_delivery_status": {"readonly": True},
- "count_by_threat_type": {"readonly": True},
- "count_by_protection_status": {"readonly": True},
- "threats": {"readonly": True},
- "query": {"readonly": True},
- "query_time": {"readonly": True},
- "mail_count": {"readonly": True},
- "is_volume_anomaly": {"readonly": True},
- "source": {"readonly": True},
- "cluster_source_identifier": {"readonly": True},
- "cluster_source_type": {"readonly": True},
- "cluster_query_start_time": {"readonly": True},
- "cluster_query_end_time": {"readonly": True},
- "cluster_group": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "network_message_ids": {"key": "networkMessageIds", "type": "[str]"},
- "count_by_delivery_status": {"key": "countByDeliveryStatus", "type": "object"},
- "count_by_threat_type": {"key": "countByThreatType", "type": "object"},
- "count_by_protection_status": {"key": "countByProtectionStatus", "type": "object"},
- "threats": {"key": "threats", "type": "[str]"},
- "query": {"key": "query", "type": "str"},
- "query_time": {"key": "queryTime", "type": "iso-8601"},
- "mail_count": {"key": "mailCount", "type": "int"},
- "is_volume_anomaly": {"key": "isVolumeAnomaly", "type": "bool"},
- "source": {"key": "source", "type": "str"},
- "cluster_source_identifier": {"key": "clusterSourceIdentifier", "type": "str"},
- "cluster_source_type": {"key": "clusterSourceType", "type": "str"},
- "cluster_query_start_time": {"key": "clusterQueryStartTime", "type": "iso-8601"},
- "cluster_query_end_time": {"key": "clusterQueryEndTime", "type": "iso-8601"},
- "cluster_group": {"key": "clusterGroup", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.network_message_ids = None
- self.count_by_delivery_status = None
- self.count_by_threat_type = None
- self.count_by_protection_status = None
- self.threats = None
- self.query = None
- self.query_time = None
- self.mail_count = None
- self.is_volume_anomaly = None
- self.source = None
- self.cluster_source_identifier = None
- self.cluster_source_type = None
- self.cluster_query_start_time = None
- self.cluster_query_end_time = None
- self.cluster_group = None
-
-
-class MailMessageEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a mail message entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar file_entity_ids: The File entity ids of this mail message's attachments.
- :vartype file_entity_ids: list[str]
- :ivar recipient: The recipient of this mail message. Note that in case of multiple recipients
- the mail message is forked and each copy has one recipient.
- :vartype recipient: str
- :ivar urls: The Urls contained in this mail message.
- :vartype urls: list[str]
- :ivar threats: The threats of this mail message.
- :vartype threats: list[str]
- :ivar p1_sender: The p1 sender's email address.
- :vartype p1_sender: str
- :ivar p1_sender_display_name: The p1 sender's display name.
- :vartype p1_sender_display_name: str
- :ivar p1_sender_domain: The p1 sender's domain.
- :vartype p1_sender_domain: str
- :ivar sender_ip: The sender's IP address.
- :vartype sender_ip: str
- :ivar p2_sender: The p2 sender's email address.
- :vartype p2_sender: str
- :ivar p2_sender_display_name: The p2 sender's display name.
- :vartype p2_sender_display_name: str
- :ivar p2_sender_domain: The p2 sender's domain.
- :vartype p2_sender_domain: str
- :ivar receive_date: The receive date of this message.
- :vartype receive_date: ~datetime.datetime
- :ivar network_message_id: The network message id of this mail message.
- :vartype network_message_id: str
- :ivar internet_message_id: The internet message id of this mail message.
- :vartype internet_message_id: str
- :ivar subject: The subject of this mail message.
- :vartype subject: str
- :ivar language: The language of this mail message.
- :vartype language: str
- :ivar threat_detection_methods: The threat detection methods.
- :vartype threat_detection_methods: list[str]
- :ivar body_fingerprint_bin1: The bodyFingerprintBin1.
- :vartype body_fingerprint_bin1: int
- :ivar body_fingerprint_bin2: The bodyFingerprintBin2.
- :vartype body_fingerprint_bin2: int
- :ivar body_fingerprint_bin3: The bodyFingerprintBin3.
- :vartype body_fingerprint_bin3: int
- :ivar body_fingerprint_bin4: The bodyFingerprintBin4.
- :vartype body_fingerprint_bin4: int
- :ivar body_fingerprint_bin5: The bodyFingerprintBin5.
- :vartype body_fingerprint_bin5: int
- :ivar antispam_direction: The directionality of this mail message. Known values are: "Unknown",
- "Inbound", "Outbound", and "Intraorg".
- :vartype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
- :ivar delivery_action: The delivery action of this mail message like Delivered, Blocked,
- Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
- "Replaced".
- :vartype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
- :ivar delivery_location: The delivery location of this mail message like Inbox, JunkFolder etc.
- Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine", "External",
- "Failed", "Dropped", and "Forwarded".
- :vartype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "file_entity_ids": {"readonly": True},
- "recipient": {"readonly": True},
- "urls": {"readonly": True},
- "threats": {"readonly": True},
- "p1_sender": {"readonly": True},
- "p1_sender_display_name": {"readonly": True},
- "p1_sender_domain": {"readonly": True},
- "sender_ip": {"readonly": True},
- "p2_sender": {"readonly": True},
- "p2_sender_display_name": {"readonly": True},
- "p2_sender_domain": {"readonly": True},
- "receive_date": {"readonly": True},
- "network_message_id": {"readonly": True},
- "internet_message_id": {"readonly": True},
- "subject": {"readonly": True},
- "language": {"readonly": True},
- "threat_detection_methods": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "file_entity_ids": {"key": "properties.fileEntityIds", "type": "[str]"},
- "recipient": {"key": "properties.recipient", "type": "str"},
- "urls": {"key": "properties.urls", "type": "[str]"},
- "threats": {"key": "properties.threats", "type": "[str]"},
- "p1_sender": {"key": "properties.p1Sender", "type": "str"},
- "p1_sender_display_name": {"key": "properties.p1SenderDisplayName", "type": "str"},
- "p1_sender_domain": {"key": "properties.p1SenderDomain", "type": "str"},
- "sender_ip": {"key": "properties.senderIP", "type": "str"},
- "p2_sender": {"key": "properties.p2Sender", "type": "str"},
- "p2_sender_display_name": {"key": "properties.p2SenderDisplayName", "type": "str"},
- "p2_sender_domain": {"key": "properties.p2SenderDomain", "type": "str"},
- "receive_date": {"key": "properties.receiveDate", "type": "iso-8601"},
- "network_message_id": {"key": "properties.networkMessageId", "type": "str"},
- "internet_message_id": {"key": "properties.internetMessageId", "type": "str"},
- "subject": {"key": "properties.subject", "type": "str"},
- "language": {"key": "properties.language", "type": "str"},
- "threat_detection_methods": {"key": "properties.threatDetectionMethods", "type": "[str]"},
- "body_fingerprint_bin1": {"key": "properties.bodyFingerprintBin1", "type": "int"},
- "body_fingerprint_bin2": {"key": "properties.bodyFingerprintBin2", "type": "int"},
- "body_fingerprint_bin3": {"key": "properties.bodyFingerprintBin3", "type": "int"},
- "body_fingerprint_bin4": {"key": "properties.bodyFingerprintBin4", "type": "int"},
- "body_fingerprint_bin5": {"key": "properties.bodyFingerprintBin5", "type": "int"},
- "antispam_direction": {"key": "properties.antispamDirection", "type": "str"},
- "delivery_action": {"key": "properties.deliveryAction", "type": "str"},
- "delivery_location": {"key": "properties.deliveryLocation", "type": "str"},
- }
-
- def __init__( # pylint: disable=too-many-locals
- self,
- *,
- body_fingerprint_bin1: Optional[int] = None,
- body_fingerprint_bin2: Optional[int] = None,
- body_fingerprint_bin3: Optional[int] = None,
- body_fingerprint_bin4: Optional[int] = None,
- body_fingerprint_bin5: Optional[int] = None,
- antispam_direction: Optional[Union[str, "_models.AntispamMailDirection"]] = None,
- delivery_action: Optional[Union[str, "_models.DeliveryAction"]] = None,
- delivery_location: Optional[Union[str, "_models.DeliveryLocation"]] = None,
- **kwargs
- ):
- """
- :keyword body_fingerprint_bin1: The bodyFingerprintBin1.
- :paramtype body_fingerprint_bin1: int
- :keyword body_fingerprint_bin2: The bodyFingerprintBin2.
- :paramtype body_fingerprint_bin2: int
- :keyword body_fingerprint_bin3: The bodyFingerprintBin3.
- :paramtype body_fingerprint_bin3: int
- :keyword body_fingerprint_bin4: The bodyFingerprintBin4.
- :paramtype body_fingerprint_bin4: int
- :keyword body_fingerprint_bin5: The bodyFingerprintBin5.
- :paramtype body_fingerprint_bin5: int
- :keyword antispam_direction: The directionality of this mail message. Known values are:
- "Unknown", "Inbound", "Outbound", and "Intraorg".
- :paramtype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
- :keyword delivery_action: The delivery action of this mail message like Delivered, Blocked,
- Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
- "Replaced".
- :paramtype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
- :keyword delivery_location: The delivery location of this mail message like Inbox, JunkFolder
- etc. Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine",
- "External", "Failed", "Dropped", and "Forwarded".
- :paramtype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
- """
- super().__init__(**kwargs)
- self.kind: str = "MailMessage"
- self.additional_data = None
- self.friendly_name = None
- self.file_entity_ids = None
- self.recipient = None
- self.urls = None
- self.threats = None
- self.p1_sender = None
- self.p1_sender_display_name = None
- self.p1_sender_domain = None
- self.sender_ip = None
- self.p2_sender = None
- self.p2_sender_display_name = None
- self.p2_sender_domain = None
- self.receive_date = None
- self.network_message_id = None
- self.internet_message_id = None
- self.subject = None
- self.language = None
- self.threat_detection_methods = None
- self.body_fingerprint_bin1 = body_fingerprint_bin1
- self.body_fingerprint_bin2 = body_fingerprint_bin2
- self.body_fingerprint_bin3 = body_fingerprint_bin3
- self.body_fingerprint_bin4 = body_fingerprint_bin4
- self.body_fingerprint_bin5 = body_fingerprint_bin5
- self.antispam_direction = antispam_direction
- self.delivery_action = delivery_action
- self.delivery_location = delivery_location
-
-
-class MailMessageEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Mail message entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar file_entity_ids: The File entity ids of this mail message's attachments.
- :vartype file_entity_ids: list[str]
- :ivar recipient: The recipient of this mail message. Note that in case of multiple recipients
- the mail message is forked and each copy has one recipient.
- :vartype recipient: str
- :ivar urls: The Urls contained in this mail message.
- :vartype urls: list[str]
- :ivar threats: The threats of this mail message.
- :vartype threats: list[str]
- :ivar p1_sender: The p1 sender's email address.
- :vartype p1_sender: str
- :ivar p1_sender_display_name: The p1 sender's display name.
- :vartype p1_sender_display_name: str
- :ivar p1_sender_domain: The p1 sender's domain.
- :vartype p1_sender_domain: str
- :ivar sender_ip: The sender's IP address.
- :vartype sender_ip: str
- :ivar p2_sender: The p2 sender's email address.
- :vartype p2_sender: str
- :ivar p2_sender_display_name: The p2 sender's display name.
- :vartype p2_sender_display_name: str
- :ivar p2_sender_domain: The p2 sender's domain.
- :vartype p2_sender_domain: str
- :ivar receive_date: The receive date of this message.
- :vartype receive_date: ~datetime.datetime
- :ivar network_message_id: The network message id of this mail message.
- :vartype network_message_id: str
- :ivar internet_message_id: The internet message id of this mail message.
- :vartype internet_message_id: str
- :ivar subject: The subject of this mail message.
- :vartype subject: str
- :ivar language: The language of this mail message.
- :vartype language: str
- :ivar threat_detection_methods: The threat detection methods.
- :vartype threat_detection_methods: list[str]
- :ivar body_fingerprint_bin1: The bodyFingerprintBin1.
- :vartype body_fingerprint_bin1: int
- :ivar body_fingerprint_bin2: The bodyFingerprintBin2.
- :vartype body_fingerprint_bin2: int
- :ivar body_fingerprint_bin3: The bodyFingerprintBin3.
- :vartype body_fingerprint_bin3: int
- :ivar body_fingerprint_bin4: The bodyFingerprintBin4.
- :vartype body_fingerprint_bin4: int
- :ivar body_fingerprint_bin5: The bodyFingerprintBin5.
- :vartype body_fingerprint_bin5: int
- :ivar antispam_direction: The directionality of this mail message. Known values are: "Unknown",
- "Inbound", "Outbound", and "Intraorg".
- :vartype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
- :ivar delivery_action: The delivery action of this mail message like Delivered, Blocked,
- Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
- "Replaced".
- :vartype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
- :ivar delivery_location: The delivery location of this mail message like Inbox, JunkFolder etc.
- Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine", "External",
- "Failed", "Dropped", and "Forwarded".
- :vartype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "file_entity_ids": {"readonly": True},
- "recipient": {"readonly": True},
- "urls": {"readonly": True},
- "threats": {"readonly": True},
- "p1_sender": {"readonly": True},
- "p1_sender_display_name": {"readonly": True},
- "p1_sender_domain": {"readonly": True},
- "sender_ip": {"readonly": True},
- "p2_sender": {"readonly": True},
- "p2_sender_display_name": {"readonly": True},
- "p2_sender_domain": {"readonly": True},
- "receive_date": {"readonly": True},
- "network_message_id": {"readonly": True},
- "internet_message_id": {"readonly": True},
- "subject": {"readonly": True},
- "language": {"readonly": True},
- "threat_detection_methods": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "file_entity_ids": {"key": "fileEntityIds", "type": "[str]"},
- "recipient": {"key": "recipient", "type": "str"},
- "urls": {"key": "urls", "type": "[str]"},
- "threats": {"key": "threats", "type": "[str]"},
- "p1_sender": {"key": "p1Sender", "type": "str"},
- "p1_sender_display_name": {"key": "p1SenderDisplayName", "type": "str"},
- "p1_sender_domain": {"key": "p1SenderDomain", "type": "str"},
- "sender_ip": {"key": "senderIP", "type": "str"},
- "p2_sender": {"key": "p2Sender", "type": "str"},
- "p2_sender_display_name": {"key": "p2SenderDisplayName", "type": "str"},
- "p2_sender_domain": {"key": "p2SenderDomain", "type": "str"},
- "receive_date": {"key": "receiveDate", "type": "iso-8601"},
- "network_message_id": {"key": "networkMessageId", "type": "str"},
- "internet_message_id": {"key": "internetMessageId", "type": "str"},
- "subject": {"key": "subject", "type": "str"},
- "language": {"key": "language", "type": "str"},
- "threat_detection_methods": {"key": "threatDetectionMethods", "type": "[str]"},
- "body_fingerprint_bin1": {"key": "bodyFingerprintBin1", "type": "int"},
- "body_fingerprint_bin2": {"key": "bodyFingerprintBin2", "type": "int"},
- "body_fingerprint_bin3": {"key": "bodyFingerprintBin3", "type": "int"},
- "body_fingerprint_bin4": {"key": "bodyFingerprintBin4", "type": "int"},
- "body_fingerprint_bin5": {"key": "bodyFingerprintBin5", "type": "int"},
- "antispam_direction": {"key": "antispamDirection", "type": "str"},
- "delivery_action": {"key": "deliveryAction", "type": "str"},
- "delivery_location": {"key": "deliveryLocation", "type": "str"},
- }
-
- def __init__( # pylint: disable=too-many-locals
- self,
- *,
- body_fingerprint_bin1: Optional[int] = None,
- body_fingerprint_bin2: Optional[int] = None,
- body_fingerprint_bin3: Optional[int] = None,
- body_fingerprint_bin4: Optional[int] = None,
- body_fingerprint_bin5: Optional[int] = None,
- antispam_direction: Optional[Union[str, "_models.AntispamMailDirection"]] = None,
- delivery_action: Optional[Union[str, "_models.DeliveryAction"]] = None,
- delivery_location: Optional[Union[str, "_models.DeliveryLocation"]] = None,
- **kwargs
- ):
- """
- :keyword body_fingerprint_bin1: The bodyFingerprintBin1.
- :paramtype body_fingerprint_bin1: int
- :keyword body_fingerprint_bin2: The bodyFingerprintBin2.
- :paramtype body_fingerprint_bin2: int
- :keyword body_fingerprint_bin3: The bodyFingerprintBin3.
- :paramtype body_fingerprint_bin3: int
- :keyword body_fingerprint_bin4: The bodyFingerprintBin4.
- :paramtype body_fingerprint_bin4: int
- :keyword body_fingerprint_bin5: The bodyFingerprintBin5.
- :paramtype body_fingerprint_bin5: int
- :keyword antispam_direction: The directionality of this mail message. Known values are:
- "Unknown", "Inbound", "Outbound", and "Intraorg".
- :paramtype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
- :keyword delivery_action: The delivery action of this mail message like Delivered, Blocked,
- Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
- "Replaced".
- :paramtype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
- :keyword delivery_location: The delivery location of this mail message like Inbox, JunkFolder
- etc. Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine",
- "External", "Failed", "Dropped", and "Forwarded".
- :paramtype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
- """
- super().__init__(**kwargs)
- self.file_entity_ids = None
- self.recipient = None
- self.urls = None
- self.threats = None
- self.p1_sender = None
- self.p1_sender_display_name = None
- self.p1_sender_domain = None
- self.sender_ip = None
- self.p2_sender = None
- self.p2_sender_display_name = None
- self.p2_sender_domain = None
- self.receive_date = None
- self.network_message_id = None
- self.internet_message_id = None
- self.subject = None
- self.language = None
- self.threat_detection_methods = None
- self.body_fingerprint_bin1 = body_fingerprint_bin1
- self.body_fingerprint_bin2 = body_fingerprint_bin2
- self.body_fingerprint_bin3 = body_fingerprint_bin3
- self.body_fingerprint_bin4 = body_fingerprint_bin4
- self.body_fingerprint_bin5 = body_fingerprint_bin5
- self.antispam_direction = antispam_direction
- self.delivery_action = delivery_action
- self.delivery_location = delivery_location
-
-
-class MalwareEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a malware entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar category: The malware category by the vendor, e.g. Trojan.
- :vartype category: str
- :ivar file_entity_ids: List of linked file entity identifiers on which the malware was found.
- :vartype file_entity_ids: list[str]
- :ivar malware_name: The malware name by the vendor, e.g. Win32/Toga!rfn.
- :vartype malware_name: str
- :ivar process_entity_ids: List of linked process entity identifiers on which the malware was
- found.
- :vartype process_entity_ids: list[str]
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "category": {"readonly": True},
- "file_entity_ids": {"readonly": True},
- "malware_name": {"readonly": True},
- "process_entity_ids": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "category": {"key": "properties.category", "type": "str"},
- "file_entity_ids": {"key": "properties.fileEntityIds", "type": "[str]"},
- "malware_name": {"key": "properties.malwareName", "type": "str"},
- "process_entity_ids": {"key": "properties.processEntityIds", "type": "[str]"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "Malware"
- self.additional_data = None
- self.friendly_name = None
- self.category = None
- self.file_entity_ids = None
- self.malware_name = None
- self.process_entity_ids = None
-
-
-class MalwareEntityProperties(EntityCommonProperties):
- """Malware entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar category: The malware category by the vendor, e.g. Trojan.
- :vartype category: str
- :ivar file_entity_ids: List of linked file entity identifiers on which the malware was found.
- :vartype file_entity_ids: list[str]
- :ivar malware_name: The malware name by the vendor, e.g. Win32/Toga!rfn.
- :vartype malware_name: str
- :ivar process_entity_ids: List of linked process entity identifiers on which the malware was
- found.
- :vartype process_entity_ids: list[str]
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "category": {"readonly": True},
- "file_entity_ids": {"readonly": True},
- "malware_name": {"readonly": True},
- "process_entity_ids": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "category": {"key": "category", "type": "str"},
- "file_entity_ids": {"key": "fileEntityIds", "type": "[str]"},
- "malware_name": {"key": "malwareName", "type": "str"},
- "process_entity_ids": {"key": "processEntityIds", "type": "[str]"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.category = None
- self.file_entity_ids = None
- self.malware_name = None
- self.process_entity_ids = None
-
-
-class ManualTriggerRequestBody(_serialization.Model):
- """ManualTriggerRequestBody.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id:
- :vartype tenant_id: str
- :ivar logic_apps_resource_id: Required.
- :vartype logic_apps_resource_id: str
- """
-
- _validation = {
- "logic_apps_resource_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "logic_apps_resource_id": {"key": "logicAppsResourceId", "type": "str"},
- }
-
- def __init__(self, *, logic_apps_resource_id: str, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id:
- :paramtype tenant_id: str
- :keyword logic_apps_resource_id: Required.
- :paramtype logic_apps_resource_id: str
- """
- super().__init__(**kwargs)
- self.tenant_id = tenant_id
- self.logic_apps_resource_id = logic_apps_resource_id
-
-
-class MCASCheckRequirements(DataConnectorsCheckRequirements):
- """Represents MCAS (Microsoft Cloud App Security) requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "MicrosoftCloudAppSecurity"
- self.tenant_id = tenant_id
-
-
-class MCASCheckRequirementsProperties(DataConnectorTenantId):
- """MCAS (Microsoft Cloud App Security) requirements check properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
-
-
-class MCASDataConnector(DataConnector):
- """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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MCASDataConnectorDataTypes
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "MCASDataConnectorDataTypes"},
- }
-
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.MCASDataConnectorDataTypes"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.MCASDataConnectorDataTypes
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftCloudAppSecurity"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
-
-class MCASDataConnectorDataTypes(AlertsDataTypeOfDataConnector):
- """The available data types for MCAS (Microsoft Cloud App Security) data connector.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar alerts: Alerts data type connection. Required.
- :vartype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
- :ivar discovery_logs: Discovery log data type connection.
- :vartype discovery_logs: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
- """
-
- _validation = {
- "alerts": {"required": True},
- }
-
- _attribute_map = {
- "alerts": {"key": "alerts", "type": "DataConnectorDataTypeCommon"},
- "discovery_logs": {"key": "discoveryLogs", "type": "DataConnectorDataTypeCommon"},
- }
-
- def __init__(
- self,
- *,
- alerts: "_models.DataConnectorDataTypeCommon",
- discovery_logs: Optional["_models.DataConnectorDataTypeCommon"] = None,
- **kwargs
- ):
- """
- :keyword alerts: Alerts data type connection. Required.
- :paramtype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
- :keyword discovery_logs: Discovery log data type connection.
- :paramtype discovery_logs: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
- """
- super().__init__(alerts=alerts, **kwargs)
- self.discovery_logs = discovery_logs
-
-
-class MCASDataConnectorProperties(DataConnectorTenantId):
- """MCAS (Microsoft Cloud App Security) data connector properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MCASDataConnectorDataTypes
- """
-
- _validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "MCASDataConnectorDataTypes"},
- }
-
- def __init__(self, *, tenant_id: str, data_types: "_models.MCASDataConnectorDataTypes", **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.MCASDataConnectorDataTypes
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
-
-class MDATPCheckRequirements(DataConnectorsCheckRequirements):
- """Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "MicrosoftDefenderAdvancedThreatProtection"
- self.tenant_id = tenant_id
-
-
-class MDATPCheckRequirementsProperties(DataConnectorTenantId):
- """MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
-
-
-class MDATPDataConnector(DataConnector):
- """Represents MDATP (Microsoft Defender Advanced Threat Protection) 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- }
-
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftDefenderAdvancedThreatProtection"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
-
-class MDATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """MDATP (Microsoft Defender Advanced Threat Protection) data connector properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, data_types=data_types, **kwargs)
- self.data_types = data_types
- self.tenant_id = tenant_id
-
-
-class MetadataAuthor(_serialization.Model):
- """Publisher or creator of the content item.
-
- :ivar name: Name of the author. Company or person.
- :vartype name: str
- :ivar email: Email of author contact.
- :vartype email: str
- :ivar link: Link for author/vendor page.
- :vartype link: str
- """
-
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "email": {"key": "email", "type": "str"},
- "link": {"key": "link", "type": "str"},
- }
-
- def __init__(
- self, *, name: Optional[str] = None, email: Optional[str] = None, link: Optional[str] = None, **kwargs
- ):
- """
- :keyword name: Name of the author. Company or person.
- :paramtype name: str
- :keyword email: Email of author contact.
- :paramtype email: str
- :keyword link: Link for author/vendor page.
- :paramtype link: str
- """
- super().__init__(**kwargs)
- self.name = name
- self.email = email
- self.link = link
-
-
-class MetadataCategories(_serialization.Model):
- """ies for the solution content item.
-
- :ivar domains: domain for the solution content item.
- :vartype domains: list[str]
- :ivar verticals: Industry verticals for the solution content item.
- :vartype verticals: list[str]
- """
-
- _attribute_map = {
- "domains": {"key": "domains", "type": "[str]"},
- "verticals": {"key": "verticals", "type": "[str]"},
- }
-
- def __init__(self, *, domains: Optional[List[str]] = None, verticals: Optional[List[str]] = None, **kwargs):
- """
- :keyword domains: domain for the solution content item.
- :paramtype domains: list[str]
- :keyword verticals: Industry verticals for the solution content item.
- :paramtype verticals: list[str]
- """
- super().__init__(**kwargs)
- self.domains = domains
- self.verticals = verticals
-
-
-class MetadataDependencies(_serialization.Model):
- """Dependencies for the content item, what other content items it requires to work. Can describe more complex dependencies using a recursive/nested structure. For a single dependency an id/kind/version can be supplied or operator/criteria for complex dependencies.
-
- :ivar content_id: Id of the content item we depend on.
- :vartype content_id: str
- :ivar kind: Type of the content item we depend on. Known values are: "DataConnector",
- "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
- "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
- "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector", and
- "AutomationRule".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.Kind
- :ivar version: Version of the the content item we depend on. Can be blank, * or missing to
- indicate any version fulfills the dependency. If version does not match our defined numeric
- format then an exact match is required.
- :vartype version: str
- :ivar name: Name of the content item.
- :vartype name: str
- :ivar operator: Operator used for list of dependencies in criteria array. Known values are:
- "AND" and "OR".
- :vartype operator: str or ~azure.mgmt.securityinsight.models.Operator
- :ivar criteria: This is the list of dependencies we must fulfill, according to the AND/OR
- operator.
- :vartype criteria: list[~azure.mgmt.securityinsight.models.MetadataDependencies]
- """
-
- _attribute_map = {
- "content_id": {"key": "contentId", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "version": {"key": "version", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "operator": {"key": "operator", "type": "str"},
- "criteria": {"key": "criteria", "type": "[MetadataDependencies]"},
- }
-
- def __init__(
- self,
- *,
- content_id: Optional[str] = None,
- kind: Optional[Union[str, "_models.Kind"]] = None,
- version: Optional[str] = None,
- name: Optional[str] = None,
- operator: Optional[Union[str, "_models.Operator"]] = None,
- criteria: Optional[List["_models.MetadataDependencies"]] = None,
- **kwargs
- ):
- """
- :keyword content_id: Id of the content item we depend on.
- :paramtype content_id: str
- :keyword kind: Type of the content item we depend on. Known values are: "DataConnector",
- "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
- "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
- "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector", and
- "AutomationRule".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.Kind
- :keyword version: Version of the the content item we depend on. Can be blank, * or missing to
- indicate any version fulfills the dependency. If version does not match our defined numeric
- format then an exact match is required.
- :paramtype version: str
- :keyword name: Name of the content item.
- :paramtype name: str
- :keyword operator: Operator used for list of dependencies in criteria array. Known values are:
- "AND" and "OR".
- :paramtype operator: str or ~azure.mgmt.securityinsight.models.Operator
- :keyword criteria: This is the list of dependencies we must fulfill, according to the AND/OR
- operator.
- :paramtype criteria: list[~azure.mgmt.securityinsight.models.MetadataDependencies]
- """
- super().__init__(**kwargs)
- self.content_id = content_id
- self.kind = kind
- self.version = version
- self.name = name
- self.operator = operator
- self.criteria = criteria
-
-
-class MetadataList(_serialization.Model):
- """List of all the metadata.
-
- 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 value: Array of metadata. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.MetadataModel]
- :ivar next_link: URL to fetch the next page of metadata.
- :vartype next_link: str
- """
-
- _validation = {
- "value": {"required": True},
- "next_link": {"readonly": True},
- }
-
- _attribute_map = {
- "value": {"key": "value", "type": "[MetadataModel]"},
- "next_link": {"key": "nextLink", "type": "str"},
- }
-
- def __init__(self, *, value: List["_models.MetadataModel"], **kwargs):
- """
- :keyword value: Array of metadata. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.MetadataModel]
- """
- super().__init__(**kwargs)
- self.value = value
- self.next_link = None
-
-
-class MetadataModel(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Metadata resource definition.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar content_id: Static ID for the content. Used to identify dependencies and content from
- solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
- for user-created. This is the resource name.
- :vartype content_id: str
- :ivar parent_id: Full parent resource ID of the content item the metadata is for. This is the
- full resource ID including the scope (subscription and resource group).
- :vartype parent_id: str
- :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
- 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we
- cannot guarantee any version checks.
- :vartype version: str
- :ivar kind: The kind of content the metadata is for. Known values are: "DataConnector",
- "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
- "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
- "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector", and
- "AutomationRule".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.Kind
- :ivar source: Source of the content. This is where/how it was created.
- :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
- :ivar author: The creator of the content item.
- :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
- :ivar support: Support information for the metadata - type, name, contact information.
- :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
- :ivar dependencies: Dependencies for the content item, what other content items it requires to
- work. Can describe more complex dependencies using a recursive/nested structure. For a single
- dependency an id/kind/version can be supplied or operator/criteria for complex formats.
- :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
- :ivar categories: Categories for the solution content item.
- :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
- :ivar providers: Providers for the solution content item.
- :vartype providers: list[str]
- :ivar first_publish_date: first publish date solution content item.
- :vartype first_publish_date: ~datetime.date
- :ivar last_publish_date: last publish date for the solution content item.
- :vartype last_publish_date: ~datetime.date
- :ivar custom_version: The custom version of the content. A optional free text.
- :vartype custom_version: str
- :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
- different flow based on the schema version.
- :vartype content_schema_version: str
- :ivar icon: the icon identifier. this id can later be fetched from the solution template.
- :vartype icon: str
- :ivar threat_analysis_tactics: the tactics the resource covers.
- :vartype threat_analysis_tactics: list[str]
- :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
- with the tactics being used.
- :vartype threat_analysis_techniques: list[str]
- :ivar preview_images: preview image file names. These will be taken from the solution
- artifacts.
- :vartype preview_images: list[str]
- :ivar preview_images_dark: preview image file names. These will be taken from the solution
- artifacts. used for dark theme support.
- :vartype preview_images_dark: list[str]
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "content_id": {"key": "properties.contentId", "type": "str"},
- "parent_id": {"key": "properties.parentId", "type": "str"},
- "version": {"key": "properties.version", "type": "str"},
- "kind": {"key": "properties.kind", "type": "str"},
- "source": {"key": "properties.source", "type": "MetadataSource"},
- "author": {"key": "properties.author", "type": "MetadataAuthor"},
- "support": {"key": "properties.support", "type": "MetadataSupport"},
- "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
- "categories": {"key": "properties.categories", "type": "MetadataCategories"},
- "providers": {"key": "properties.providers", "type": "[str]"},
- "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
- "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
- "custom_version": {"key": "properties.customVersion", "type": "str"},
- "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
- "icon": {"key": "properties.icon", "type": "str"},
- "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
- "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
- "preview_images": {"key": "properties.previewImages", "type": "[str]"},
- "preview_images_dark": {"key": "properties.previewImagesDark", "type": "[str]"},
- }
-
- def __init__( # pylint: disable=too-many-locals
- self,
- *,
- etag: Optional[str] = None,
- content_id: Optional[str] = None,
- parent_id: Optional[str] = None,
- version: Optional[str] = None,
- kind: Optional[Union[str, "_models.Kind"]] = None,
- source: Optional["_models.MetadataSource"] = None,
- author: Optional["_models.MetadataAuthor"] = None,
- support: Optional["_models.MetadataSupport"] = None,
- dependencies: Optional["_models.MetadataDependencies"] = None,
- categories: Optional["_models.MetadataCategories"] = None,
- providers: Optional[List[str]] = None,
- first_publish_date: Optional[datetime.date] = None,
- last_publish_date: Optional[datetime.date] = None,
- custom_version: Optional[str] = None,
- content_schema_version: Optional[str] = None,
- icon: Optional[str] = None,
- threat_analysis_tactics: Optional[List[str]] = None,
- threat_analysis_techniques: Optional[List[str]] = None,
- preview_images: Optional[List[str]] = None,
- preview_images_dark: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword content_id: Static ID for the content. Used to identify dependencies and content from
- solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
- for user-created. This is the resource name.
- :paramtype content_id: str
- :keyword parent_id: Full parent resource ID of the content item the metadata is for. This is
- the full resource ID including the scope (subscription and resource group).
- :paramtype parent_id: str
- :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
- 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then
- we cannot guarantee any version checks.
- :paramtype version: str
- :keyword kind: The kind of content the metadata is for. Known values are: "DataConnector",
- "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
- "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
- "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector", and
- "AutomationRule".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.Kind
- :keyword source: Source of the content. This is where/how it was created.
- :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
- :keyword author: The creator of the content item.
- :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
- :keyword support: Support information for the metadata - type, name, contact information.
- :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
- :keyword dependencies: Dependencies for the content item, what other content items it requires
- to work. Can describe more complex dependencies using a recursive/nested structure. For a
- single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
- :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
- :keyword categories: Categories for the solution content item.
- :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
- :keyword providers: Providers for the solution content item.
- :paramtype providers: list[str]
- :keyword first_publish_date: first publish date solution content item.
- :paramtype first_publish_date: ~datetime.date
- :keyword last_publish_date: last publish date for the solution content item.
- :paramtype last_publish_date: ~datetime.date
- :keyword custom_version: The custom version of the content. A optional free text.
- :paramtype custom_version: str
- :keyword content_schema_version: Schema version of the content. Can be used to distinguish
- between different flow based on the schema version.
- :paramtype content_schema_version: str
- :keyword icon: the icon identifier. this id can later be fetched from the solution template.
- :paramtype icon: str
- :keyword threat_analysis_tactics: the tactics the resource covers.
- :paramtype threat_analysis_tactics: list[str]
- :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
- aligned with the tactics being used.
- :paramtype threat_analysis_techniques: list[str]
- :keyword preview_images: preview image file names. These will be taken from the solution
- artifacts.
- :paramtype preview_images: list[str]
- :keyword preview_images_dark: preview image file names. These will be taken from the solution
- artifacts. used for dark theme support.
- :paramtype preview_images_dark: list[str]
- """
- super().__init__(etag=etag, **kwargs)
- self.content_id = content_id
- self.parent_id = parent_id
- self.version = version
- self.kind = kind
- self.source = source
- self.author = author
- self.support = support
- self.dependencies = dependencies
- self.categories = categories
- self.providers = providers
- self.first_publish_date = first_publish_date
- self.last_publish_date = last_publish_date
- self.custom_version = custom_version
- self.content_schema_version = content_schema_version
- self.icon = icon
- self.threat_analysis_tactics = threat_analysis_tactics
- self.threat_analysis_techniques = threat_analysis_techniques
- self.preview_images = preview_images
- self.preview_images_dark = preview_images_dark
-
-
-class MetadataPatch(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Metadata patch request body.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar content_id: Static ID for the content. Used to identify dependencies and content from
- solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
- for user-created. This is the resource name.
- :vartype content_id: str
- :ivar parent_id: Full parent resource ID of the content item the metadata is for. This is the
- full resource ID including the scope (subscription and resource group).
- :vartype parent_id: str
- :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
- 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we
- cannot guarantee any version checks.
- :vartype version: str
- :ivar kind: The kind of content the metadata is for. Known values are: "DataConnector",
- "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
- "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
- "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector", and
- "AutomationRule".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.Kind
- :ivar source: Source of the content. This is where/how it was created.
- :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
- :ivar author: The creator of the content item.
- :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
- :ivar support: Support information for the metadata - type, name, contact information.
- :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
- :ivar dependencies: Dependencies for the content item, what other content items it requires to
- work. Can describe more complex dependencies using a recursive/nested structure. For a single
- dependency an id/kind/version can be supplied or operator/criteria for complex formats.
- :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
- :ivar categories: Categories for the solution content item.
- :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
- :ivar providers: Providers for the solution content item.
- :vartype providers: list[str]
- :ivar first_publish_date: first publish date solution content item.
- :vartype first_publish_date: ~datetime.date
- :ivar last_publish_date: last publish date for the solution content item.
- :vartype last_publish_date: ~datetime.date
- :ivar custom_version: The custom version of the content. A optional free text.
- :vartype custom_version: str
- :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
- different flow based on the schema version.
- :vartype content_schema_version: str
- :ivar icon: the icon identifier. this id can later be fetched from the solution template.
- :vartype icon: str
- :ivar threat_analysis_tactics: the tactics the resource covers.
- :vartype threat_analysis_tactics: list[str]
- :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
- with the tactics being used.
- :vartype threat_analysis_techniques: list[str]
- :ivar preview_images: preview image file names. These will be taken from the solution
- artifacts.
- :vartype preview_images: list[str]
- :ivar preview_images_dark: preview image file names. These will be taken from the solution
- artifacts. used for dark theme support.
- :vartype preview_images_dark: list[str]
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "content_id": {"key": "properties.contentId", "type": "str"},
- "parent_id": {"key": "properties.parentId", "type": "str"},
- "version": {"key": "properties.version", "type": "str"},
- "kind": {"key": "properties.kind", "type": "str"},
- "source": {"key": "properties.source", "type": "MetadataSource"},
- "author": {"key": "properties.author", "type": "MetadataAuthor"},
- "support": {"key": "properties.support", "type": "MetadataSupport"},
- "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
- "categories": {"key": "properties.categories", "type": "MetadataCategories"},
- "providers": {"key": "properties.providers", "type": "[str]"},
- "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
- "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
- "custom_version": {"key": "properties.customVersion", "type": "str"},
- "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
- "icon": {"key": "properties.icon", "type": "str"},
- "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
- "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
- "preview_images": {"key": "properties.previewImages", "type": "[str]"},
- "preview_images_dark": {"key": "properties.previewImagesDark", "type": "[str]"},
- }
-
- def __init__( # pylint: disable=too-many-locals
- self,
- *,
- etag: Optional[str] = None,
- content_id: Optional[str] = None,
- parent_id: Optional[str] = None,
- version: Optional[str] = None,
- kind: Optional[Union[str, "_models.Kind"]] = None,
- source: Optional["_models.MetadataSource"] = None,
- author: Optional["_models.MetadataAuthor"] = None,
- support: Optional["_models.MetadataSupport"] = None,
- dependencies: Optional["_models.MetadataDependencies"] = None,
- categories: Optional["_models.MetadataCategories"] = None,
- providers: Optional[List[str]] = None,
- first_publish_date: Optional[datetime.date] = None,
- last_publish_date: Optional[datetime.date] = None,
- custom_version: Optional[str] = None,
- content_schema_version: Optional[str] = None,
- icon: Optional[str] = None,
- threat_analysis_tactics: Optional[List[str]] = None,
- threat_analysis_techniques: Optional[List[str]] = None,
- preview_images: Optional[List[str]] = None,
- preview_images_dark: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword content_id: Static ID for the content. Used to identify dependencies and content from
- solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
- for user-created. This is the resource name.
- :paramtype content_id: str
- :keyword parent_id: Full parent resource ID of the content item the metadata is for. This is
- the full resource ID including the scope (subscription and resource group).
- :paramtype parent_id: str
- :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
- 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then
- we cannot guarantee any version checks.
- :paramtype version: str
- :keyword kind: The kind of content the metadata is for. Known values are: "DataConnector",
- "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
- "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
- "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector", and
- "AutomationRule".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.Kind
- :keyword source: Source of the content. This is where/how it was created.
- :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
- :keyword author: The creator of the content item.
- :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
- :keyword support: Support information for the metadata - type, name, contact information.
- :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
- :keyword dependencies: Dependencies for the content item, what other content items it requires
- to work. Can describe more complex dependencies using a recursive/nested structure. For a
- single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
- :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
- :keyword categories: Categories for the solution content item.
- :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
- :keyword providers: Providers for the solution content item.
- :paramtype providers: list[str]
- :keyword first_publish_date: first publish date solution content item.
- :paramtype first_publish_date: ~datetime.date
- :keyword last_publish_date: last publish date for the solution content item.
- :paramtype last_publish_date: ~datetime.date
- :keyword custom_version: The custom version of the content. A optional free text.
- :paramtype custom_version: str
- :keyword content_schema_version: Schema version of the content. Can be used to distinguish
- between different flow based on the schema version.
- :paramtype content_schema_version: str
- :keyword icon: the icon identifier. this id can later be fetched from the solution template.
- :paramtype icon: str
- :keyword threat_analysis_tactics: the tactics the resource covers.
- :paramtype threat_analysis_tactics: list[str]
- :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
- aligned with the tactics being used.
- :paramtype threat_analysis_techniques: list[str]
- :keyword preview_images: preview image file names. These will be taken from the solution
- artifacts.
- :paramtype preview_images: list[str]
- :keyword preview_images_dark: preview image file names. These will be taken from the solution
- artifacts. used for dark theme support.
- :paramtype preview_images_dark: list[str]
- """
- super().__init__(etag=etag, **kwargs)
- self.content_id = content_id
- self.parent_id = parent_id
- self.version = version
- self.kind = kind
- self.source = source
- self.author = author
- self.support = support
- self.dependencies = dependencies
- self.categories = categories
- self.providers = providers
- self.first_publish_date = first_publish_date
- self.last_publish_date = last_publish_date
- self.custom_version = custom_version
- self.content_schema_version = content_schema_version
- self.icon = icon
- self.threat_analysis_tactics = threat_analysis_tactics
- self.threat_analysis_techniques = threat_analysis_techniques
- self.preview_images = preview_images
- self.preview_images_dark = preview_images_dark
-
-
-class MetadataSource(_serialization.Model):
- """The original source of the content item, where it comes from.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Source type of the content. Required. Known values are: "LocalWorkspace",
- "Community", "Solution", and "SourceRepository".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SourceKind
- :ivar name: Name of the content source. The repo name, solution name, LA workspace name etc.
- :vartype name: str
- :ivar source_id: ID of the content source. The solution ID, workspace ID, etc.
- :vartype source_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "source_id": {"key": "sourceId", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- kind: Union[str, "_models.SourceKind"],
- name: Optional[str] = None,
- source_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword kind: Source type of the content. Required. Known values are: "LocalWorkspace",
- "Community", "Solution", and "SourceRepository".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.SourceKind
- :keyword name: Name of the content source. The repo name, solution name, LA workspace name
- etc.
- :paramtype name: str
- :keyword source_id: ID of the content source. The solution ID, workspace ID, etc.
- :paramtype source_id: str
- """
- super().__init__(**kwargs)
- self.kind = kind
- self.name = name
- self.source_id = source_id
-
-
-class MetadataSupport(_serialization.Model):
- """Support information for the content item.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tier: Type of support for content item. Required. Known values are: "Microsoft",
- "Partner", and "Community".
- :vartype tier: str or ~azure.mgmt.securityinsight.models.SupportTier
- :ivar name: Name of the support contact. Company or person.
- :vartype name: str
- :ivar email: Email of support contact.
- :vartype email: str
- :ivar link: Link for support help, like to support page to open a ticket etc.
- :vartype link: str
- """
-
- _validation = {
- "tier": {"required": True},
- }
-
- _attribute_map = {
- "tier": {"key": "tier", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "email": {"key": "email", "type": "str"},
- "link": {"key": "link", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- tier: Union[str, "_models.SupportTier"],
- name: Optional[str] = None,
- email: Optional[str] = None,
- link: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword tier: Type of support for content item. Required. Known values are: "Microsoft",
- "Partner", and "Community".
- :paramtype tier: str or ~azure.mgmt.securityinsight.models.SupportTier
- :keyword name: Name of the support contact. Company or person.
- :paramtype name: str
- :keyword email: Email of support contact.
- :paramtype email: str
- :keyword link: Link for support help, like to support page to open a ticket etc.
- :paramtype link: str
- """
- super().__init__(**kwargs)
- self.tier = tier
- self.name = name
- self.email = email
- self.link = link
-
-
-class MicrosoftSecurityIncidentCreationAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents MicrosoftSecurityIncidentCreation rule.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
- :vartype display_names_filter: list[str]
- :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :vartype display_names_exclude_filter: list[str]
- :ivar product_filter: The alerts' productName on which the cases will be generated. Known
- values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
- Protection", "Azure Active Directory Identity Protection", "Azure Security Center for IoT",
- "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat Protection".
- :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :ivar severities_filter: the alerts' severities on which the cases will be generated.
- :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
- :vartype alert_rule_template_name: str
- :ivar description: The description of the alert rule.
- :vartype description: str
- :ivar display_name: The display name for alerts created by this alert rule.
- :vartype display_name: str
- :ivar enabled: Determines whether this alert rule is enabled or disabled.
- :vartype enabled: bool
- :ivar last_modified_utc: The last time that this alert has been modified.
- :vartype last_modified_utc: ~datetime.datetime
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_modified_utc": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "display_names_filter": {"key": "properties.displayNamesFilter", "type": "[str]"},
- "display_names_exclude_filter": {"key": "properties.displayNamesExcludeFilter", "type": "[str]"},
- "product_filter": {"key": "properties.productFilter", "type": "str"},
- "severities_filter": {"key": "properties.severitiesFilter", "type": "[str]"},
- "alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
- }
-
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- display_names_filter: Optional[List[str]] = None,
- display_names_exclude_filter: Optional[List[str]] = None,
- product_filter: Optional[Union[str, "_models.MicrosoftSecurityProductName"]] = None,
- severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- alert_rule_template_name: Optional[str] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
- :paramtype display_names_filter: list[str]
- :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :paramtype display_names_exclude_filter: list[str]
- :keyword product_filter: The alerts' productName on which the cases will be generated. Known
- values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
- Protection", "Azure Active Directory Identity Protection", "Azure Security Center for IoT",
- "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat Protection".
- :paramtype product_filter: str or
- ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :keyword severities_filter: the alerts' severities on which the cases will be generated.
- :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- :keyword alert_rule_template_name: The Name of the alert rule template used to create this
- rule.
- :paramtype alert_rule_template_name: str
- :keyword description: The description of the alert rule.
- :paramtype description: str
- :keyword display_name: The display name for alerts created by this alert rule.
- :paramtype display_name: str
- :keyword enabled: Determines whether this alert rule is enabled or disabled.
- :paramtype enabled: bool
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftSecurityIncidentCreation"
- self.display_names_filter = display_names_filter
- self.display_names_exclude_filter = display_names_exclude_filter
- self.product_filter = product_filter
- self.severities_filter = severities_filter
- self.alert_rule_template_name = alert_rule_template_name
- self.description = description
- self.display_name = display_name
- self.enabled = enabled
- self.last_modified_utc = None
-
-
-class MicrosoftSecurityIncidentCreationAlertRuleCommonProperties(_serialization.Model):
- """MicrosoftSecurityIncidentCreation rule common property bag.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
- :vartype display_names_filter: list[str]
- :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :vartype display_names_exclude_filter: list[str]
- :ivar product_filter: The alerts' productName on which the cases will be generated. Required.
- Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced
- Threat Protection", "Azure Active Directory Identity Protection", "Azure Security Center for
- IoT", "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat
- Protection".
- :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :ivar severities_filter: the alerts' severities on which the cases will be generated.
- :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- """
-
- _validation = {
- "product_filter": {"required": True},
- }
-
- _attribute_map = {
- "display_names_filter": {"key": "displayNamesFilter", "type": "[str]"},
- "display_names_exclude_filter": {"key": "displayNamesExcludeFilter", "type": "[str]"},
- "product_filter": {"key": "productFilter", "type": "str"},
- "severities_filter": {"key": "severitiesFilter", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- product_filter: Union[str, "_models.MicrosoftSecurityProductName"],
- display_names_filter: Optional[List[str]] = None,
- display_names_exclude_filter: Optional[List[str]] = None,
- severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- **kwargs
- ):
- """
- :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
- :paramtype display_names_filter: list[str]
- :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :paramtype display_names_exclude_filter: list[str]
- :keyword product_filter: The alerts' productName on which the cases will be generated.
- Required. Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure
- Advanced Threat Protection", "Azure Active Directory Identity Protection", "Azure Security
- Center for IoT", "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced
- Threat Protection".
- :paramtype product_filter: str or
- ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :keyword severities_filter: the alerts' severities on which the cases will be generated.
- :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- """
- super().__init__(**kwargs)
- self.display_names_filter = display_names_filter
- self.display_names_exclude_filter = display_names_exclude_filter
- self.product_filter = product_filter
- self.severities_filter = severities_filter
-
-
-class MicrosoftSecurityIncidentCreationAlertRuleProperties(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties):
- """MicrosoftSecurityIncidentCreation rule property bag.
-
- 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 display_names_filter: the alerts' displayNames on which the cases will be generated.
- :vartype display_names_filter: list[str]
- :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :vartype display_names_exclude_filter: list[str]
- :ivar product_filter: The alerts' productName on which the cases will be generated. Required.
- Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced
- Threat Protection", "Azure Active Directory Identity Protection", "Azure Security Center for
- IoT", "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat
- Protection".
- :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :ivar severities_filter: the alerts' severities on which the cases will be generated.
- :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
- :vartype alert_rule_template_name: str
- :ivar description: The description of the alert rule.
- :vartype description: str
- :ivar display_name: The display name for alerts created by this alert rule. Required.
- :vartype display_name: str
- :ivar enabled: Determines whether this alert rule is enabled or disabled. Required.
- :vartype enabled: bool
- :ivar last_modified_utc: The last time that this alert has been modified.
- :vartype last_modified_utc: ~datetime.datetime
- """
-
- _validation = {
- "product_filter": {"required": True},
- "display_name": {"required": True},
- "enabled": {"required": True},
- "last_modified_utc": {"readonly": True},
- }
-
- _attribute_map = {
- "display_names_filter": {"key": "displayNamesFilter", "type": "[str]"},
- "display_names_exclude_filter": {"key": "displayNamesExcludeFilter", "type": "[str]"},
- "product_filter": {"key": "productFilter", "type": "str"},
- "severities_filter": {"key": "severitiesFilter", "type": "[str]"},
- "alert_rule_template_name": {"key": "alertRuleTemplateName", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "enabled": {"key": "enabled", "type": "bool"},
- "last_modified_utc": {"key": "lastModifiedUtc", "type": "iso-8601"},
- }
-
- def __init__(
- self,
- *,
- product_filter: Union[str, "_models.MicrosoftSecurityProductName"],
- display_name: str,
- enabled: bool,
- display_names_filter: Optional[List[str]] = None,
- display_names_exclude_filter: Optional[List[str]] = None,
- severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- alert_rule_template_name: Optional[str] = None,
- description: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
- :paramtype display_names_filter: list[str]
- :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :paramtype display_names_exclude_filter: list[str]
- :keyword product_filter: The alerts' productName on which the cases will be generated.
- Required. Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure
- Advanced Threat Protection", "Azure Active Directory Identity Protection", "Azure Security
- Center for IoT", "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced
- Threat Protection".
- :paramtype product_filter: str or
- ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :keyword severities_filter: the alerts' severities on which the cases will be generated.
- :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- :keyword alert_rule_template_name: The Name of the alert rule template used to create this
- rule.
- :paramtype alert_rule_template_name: str
- :keyword description: The description of the alert rule.
- :paramtype description: str
- :keyword display_name: The display name for alerts created by this alert rule. Required.
- :paramtype display_name: str
- :keyword enabled: Determines whether this alert rule is enabled or disabled. Required.
- :paramtype enabled: bool
- """
- super().__init__(
- display_names_filter=display_names_filter,
- display_names_exclude_filter=display_names_exclude_filter,
- product_filter=product_filter,
- severities_filter=severities_filter,
- **kwargs
- )
- self.alert_rule_template_name = alert_rule_template_name
- self.description = description
- self.display_name = display_name
- self.enabled = enabled
- self.last_modified_utc = None
-
-
-class MicrosoftSecurityIncidentCreationAlertRuleTemplate(
- AlertRuleTemplate
-): # pylint: disable=too-many-instance-attributes
- """Represents MicrosoftSecurityIncidentCreation rule template.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
- :vartype display_names_filter: list[str]
- :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :vartype display_names_exclude_filter: list[str]
- :ivar product_filter: The alerts' productName on which the cases will be generated. Known
- values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
- Protection", "Azure Active Directory Identity Protection", "Azure Security Center for IoT",
- "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat Protection".
- :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :ivar severities_filter: the alerts' severities on which the cases will be generated.
- :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "required_data_connectors": {
- "key": "properties.requiredDataConnectors",
- "type": "[AlertRuleTemplateDataSource]",
- },
- "status": {"key": "properties.status", "type": "str"},
- "display_names_filter": {"key": "properties.displayNamesFilter", "type": "[str]"},
- "display_names_exclude_filter": {"key": "properties.displayNamesExcludeFilter", "type": "[str]"},
- "product_filter": {"key": "properties.productFilter", "type": "str"},
- "severities_filter": {"key": "properties.severitiesFilter", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- display_names_filter: Optional[List[str]] = None,
- display_names_exclude_filter: Optional[List[str]] = None,
- product_filter: Optional[Union[str, "_models.MicrosoftSecurityProductName"]] = None,
- severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
- :paramtype display_names_filter: list[str]
- :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :paramtype display_names_exclude_filter: list[str]
- :keyword product_filter: The alerts' productName on which the cases will be generated. Known
- values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
- Protection", "Azure Active Directory Identity Protection", "Azure Security Center for IoT",
- "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat Protection".
- :paramtype product_filter: str or
- ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :keyword severities_filter: the alerts' severities on which the cases will be generated.
- :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- """
- super().__init__(**kwargs)
- self.kind: str = "MicrosoftSecurityIncidentCreation"
- self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.last_updated_date_utc = None
- self.created_date_utc = None
- self.description = description
- self.display_name = display_name
- self.required_data_connectors = required_data_connectors
- self.status = status
- self.display_names_filter = display_names_filter
- self.display_names_exclude_filter = display_names_exclude_filter
- self.product_filter = product_filter
- self.severities_filter = severities_filter
-
-
-class MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(
- AlertRuleTemplatePropertiesBase
-): # pylint: disable=too-many-instance-attributes
- """MicrosoftSecurityIncidentCreation rule template properties.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
- :vartype display_names_filter: list[str]
- :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :vartype display_names_exclude_filter: list[str]
- :ivar product_filter: The alerts' productName on which the cases will be generated. Known
- values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
- Protection", "Azure Active Directory Identity Protection", "Azure Security Center for IoT",
- "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat Protection".
- :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :ivar severities_filter: the alerts' severities on which the cases will be generated.
- :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
- """
-
- _validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
- }
-
- _attribute_map = {
- "alert_rules_created_by_template_count": {"key": "alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "createdDateUTC", "type": "iso-8601"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "required_data_connectors": {"key": "requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
- "status": {"key": "status", "type": "str"},
- "display_names_filter": {"key": "displayNamesFilter", "type": "[str]"},
- "display_names_exclude_filter": {"key": "displayNamesExcludeFilter", "type": "[str]"},
- "product_filter": {"key": "productFilter", "type": "str"},
- "severities_filter": {"key": "severitiesFilter", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- display_names_filter: Optional[List[str]] = None,
- display_names_exclude_filter: Optional[List[str]] = None,
- product_filter: Optional[Union[str, "_models.MicrosoftSecurityProductName"]] = None,
- severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
- :paramtype display_names_filter: list[str]
- :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
- generated.
- :paramtype display_names_exclude_filter: list[str]
- :keyword product_filter: The alerts' productName on which the cases will be generated. Known
- values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
- Protection", "Azure Active Directory Identity Protection", "Azure Security Center for IoT",
- "Office 365 Advanced Threat Protection", and "Microsoft Defender Advanced Threat Protection".
- :paramtype product_filter: str or
- ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
- :keyword severities_filter: the alerts' severities on which the cases will be generated.
- :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
+ :keyword body_fingerprint_bin1: The bodyFingerprintBin1.
+ :paramtype body_fingerprint_bin1: int
+ :keyword body_fingerprint_bin2: The bodyFingerprintBin2.
+ :paramtype body_fingerprint_bin2: int
+ :keyword body_fingerprint_bin3: The bodyFingerprintBin3.
+ :paramtype body_fingerprint_bin3: int
+ :keyword body_fingerprint_bin4: The bodyFingerprintBin4.
+ :paramtype body_fingerprint_bin4: int
+ :keyword body_fingerprint_bin5: The bodyFingerprintBin5.
+ :paramtype body_fingerprint_bin5: int
+ :keyword antispam_direction: The directionality of this mail message. Known values are:
+ "Unknown", "Inbound", "Outbound", and "Intraorg".
+ :paramtype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
+ :keyword delivery_action: The delivery action of this mail message like Delivered, Blocked,
+ Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
+ "Replaced".
+ :paramtype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
+ :keyword delivery_location: The delivery location of this mail message like Inbox, JunkFolder
+ etc. Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine",
+ "External", "Failed", "Dropped", and "Forwarded".
+ :paramtype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
"""
- super().__init__(
- alert_rules_created_by_template_count=alert_rules_created_by_template_count,
- description=description,
- display_name=display_name,
- required_data_connectors=required_data_connectors,
- status=status,
- **kwargs
- )
- self.display_names_filter = display_names_filter
- self.display_names_exclude_filter = display_names_exclude_filter
- self.product_filter = product_filter
- self.severities_filter = severities_filter
+ super().__init__(**kwargs)
+ self.kind: str = "MailMessage"
+ self.additional_data = None
+ self.friendly_name = None
+ self.file_entity_ids = None
+ self.recipient = None
+ self.urls = None
+ self.threats = None
+ self.p1_sender = None
+ self.p1_sender_display_name = None
+ self.p1_sender_domain = None
+ self.sender_ip = None
+ self.p2_sender = None
+ self.p2_sender_display_name = None
+ self.p2_sender_domain = None
+ self.receive_date = None
+ self.network_message_id = None
+ self.internet_message_id = None
+ self.subject = None
+ self.language = None
+ self.threat_detection_methods = None
+ self.body_fingerprint_bin1 = body_fingerprint_bin1
+ self.body_fingerprint_bin2 = body_fingerprint_bin2
+ self.body_fingerprint_bin3 = body_fingerprint_bin3
+ self.body_fingerprint_bin4 = body_fingerprint_bin4
+ self.body_fingerprint_bin5 = body_fingerprint_bin5
+ self.antispam_direction = antispam_direction
+ self.delivery_action = delivery_action
+ self.delivery_location = delivery_location
-class MLBehaviorAnalyticsAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents MLBehaviorAnalytics alert rule.
+class MailMessageEntityProperties(EntityCommonProperties):
+ """Mail message entity property bag.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
- :vartype alert_rule_template_name: str
- :ivar description: The description of the alert rule.
- :vartype description: str
- :ivar display_name: The display name for alerts created by this alert rule.
- :vartype display_name: str
- :ivar enabled: Determines whether this alert rule is enabled or disabled.
- :vartype enabled: bool
- :ivar last_modified_utc: The last time that this alert rule has been modified.
- :vartype last_modified_utc: ~datetime.datetime
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar file_entity_ids: The File entity ids of this mail message's attachments.
+ :vartype file_entity_ids: list[str]
+ :ivar recipient: The recipient of this mail message. Note that in case of multiple recipients
+ the mail message is forked and each copy has one recipient.
+ :vartype recipient: str
+ :ivar urls: The Urls contained in this mail message.
+ :vartype urls: list[str]
+ :ivar threats: The threats of this mail message.
+ :vartype threats: list[str]
+ :ivar p1_sender: The p1 sender's email address.
+ :vartype p1_sender: str
+ :ivar p1_sender_display_name: The p1 sender's display name.
+ :vartype p1_sender_display_name: str
+ :ivar p1_sender_domain: The p1 sender's domain.
+ :vartype p1_sender_domain: str
+ :ivar sender_ip: The sender's IP address.
+ :vartype sender_ip: str
+ :ivar p2_sender: The p2 sender's email address.
+ :vartype p2_sender: str
+ :ivar p2_sender_display_name: The p2 sender's display name.
+ :vartype p2_sender_display_name: str
+ :ivar p2_sender_domain: The p2 sender's domain.
+ :vartype p2_sender_domain: str
+ :ivar receive_date: The receive date of this message.
+ :vartype receive_date: ~datetime.datetime
+ :ivar network_message_id: The network message id of this mail message.
+ :vartype network_message_id: str
+ :ivar internet_message_id: The internet message id of this mail message.
+ :vartype internet_message_id: str
+ :ivar subject: The subject of this mail message.
+ :vartype subject: str
+ :ivar language: The language of this mail message.
+ :vartype language: str
+ :ivar threat_detection_methods: The threat detection methods.
+ :vartype threat_detection_methods: list[str]
+ :ivar body_fingerprint_bin1: The bodyFingerprintBin1.
+ :vartype body_fingerprint_bin1: int
+ :ivar body_fingerprint_bin2: The bodyFingerprintBin2.
+ :vartype body_fingerprint_bin2: int
+ :ivar body_fingerprint_bin3: The bodyFingerprintBin3.
+ :vartype body_fingerprint_bin3: int
+ :ivar body_fingerprint_bin4: The bodyFingerprintBin4.
+ :vartype body_fingerprint_bin4: int
+ :ivar body_fingerprint_bin5: The bodyFingerprintBin5.
+ :vartype body_fingerprint_bin5: int
+ :ivar antispam_direction: The directionality of this mail message. Known values are: "Unknown",
+ "Inbound", "Outbound", and "Intraorg".
+ :vartype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
+ :ivar delivery_action: The delivery action of this mail message like Delivered, Blocked,
+ Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
+ "Replaced".
+ :vartype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
+ :ivar delivery_location: The delivery location of this mail message like Inbox, JunkFolder etc.
+ Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine", "External",
+ "Failed", "Dropped", and "Forwarded".
+ :vartype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "description": {"readonly": True},
- "display_name": {"readonly": True},
- "last_modified_utc": {"readonly": True},
- "severity": {"readonly": True},
- "tactics": {"readonly": True},
- "techniques": {"readonly": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "file_entity_ids": {"readonly": True},
+ "recipient": {"readonly": True},
+ "urls": {"readonly": True},
+ "threats": {"readonly": True},
+ "p1_sender": {"readonly": True},
+ "p1_sender_display_name": {"readonly": True},
+ "p1_sender_domain": {"readonly": True},
+ "sender_ip": {"readonly": True},
+ "p2_sender": {"readonly": True},
+ "p2_sender_display_name": {"readonly": True},
+ "p2_sender_domain": {"readonly": True},
+ "receive_date": {"readonly": True},
+ "network_message_id": {"readonly": True},
+ "internet_message_id": {"readonly": True},
+ "subject": {"readonly": True},
+ "language": {"readonly": True},
+ "threat_detection_methods": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
- "severity": {"key": "properties.severity", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "file_entity_ids": {"key": "fileEntityIds", "type": "[str]"},
+ "recipient": {"key": "recipient", "type": "str"},
+ "urls": {"key": "urls", "type": "[str]"},
+ "threats": {"key": "threats", "type": "[str]"},
+ "p1_sender": {"key": "p1Sender", "type": "str"},
+ "p1_sender_display_name": {"key": "p1SenderDisplayName", "type": "str"},
+ "p1_sender_domain": {"key": "p1SenderDomain", "type": "str"},
+ "sender_ip": {"key": "senderIP", "type": "str"},
+ "p2_sender": {"key": "p2Sender", "type": "str"},
+ "p2_sender_display_name": {"key": "p2SenderDisplayName", "type": "str"},
+ "p2_sender_domain": {"key": "p2SenderDomain", "type": "str"},
+ "receive_date": {"key": "receiveDate", "type": "iso-8601"},
+ "network_message_id": {"key": "networkMessageId", "type": "str"},
+ "internet_message_id": {"key": "internetMessageId", "type": "str"},
+ "subject": {"key": "subject", "type": "str"},
+ "language": {"key": "language", "type": "str"},
+ "threat_detection_methods": {"key": "threatDetectionMethods", "type": "[str]"},
+ "body_fingerprint_bin1": {"key": "bodyFingerprintBin1", "type": "int"},
+ "body_fingerprint_bin2": {"key": "bodyFingerprintBin2", "type": "int"},
+ "body_fingerprint_bin3": {"key": "bodyFingerprintBin3", "type": "int"},
+ "body_fingerprint_bin4": {"key": "bodyFingerprintBin4", "type": "int"},
+ "body_fingerprint_bin5": {"key": "bodyFingerprintBin5", "type": "int"},
+ "antispam_direction": {"key": "antispamDirection", "type": "str"},
+ "delivery_action": {"key": "deliveryAction", "type": "str"},
+ "delivery_location": {"key": "deliveryLocation", "type": "str"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
- etag: Optional[str] = None,
- alert_rule_template_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- **kwargs
- ):
+ body_fingerprint_bin1: Optional[int] = None,
+ body_fingerprint_bin2: Optional[int] = None,
+ body_fingerprint_bin3: Optional[int] = None,
+ body_fingerprint_bin4: Optional[int] = None,
+ body_fingerprint_bin5: Optional[int] = None,
+ antispam_direction: Optional[Union[str, "_models.AntispamMailDirection"]] = None,
+ delivery_action: Optional[Union[str, "_models.DeliveryAction"]] = None,
+ delivery_location: Optional[Union[str, "_models.DeliveryLocation"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword alert_rule_template_name: The Name of the alert rule template used to create this
- rule.
- :paramtype alert_rule_template_name: str
- :keyword enabled: Determines whether this alert rule is enabled or disabled.
- :paramtype enabled: bool
+ :keyword body_fingerprint_bin1: The bodyFingerprintBin1.
+ :paramtype body_fingerprint_bin1: int
+ :keyword body_fingerprint_bin2: The bodyFingerprintBin2.
+ :paramtype body_fingerprint_bin2: int
+ :keyword body_fingerprint_bin3: The bodyFingerprintBin3.
+ :paramtype body_fingerprint_bin3: int
+ :keyword body_fingerprint_bin4: The bodyFingerprintBin4.
+ :paramtype body_fingerprint_bin4: int
+ :keyword body_fingerprint_bin5: The bodyFingerprintBin5.
+ :paramtype body_fingerprint_bin5: int
+ :keyword antispam_direction: The directionality of this mail message. Known values are:
+ "Unknown", "Inbound", "Outbound", and "Intraorg".
+ :paramtype antispam_direction: str or ~azure.mgmt.securityinsight.models.AntispamMailDirection
+ :keyword delivery_action: The delivery action of this mail message like Delivered, Blocked,
+ Replaced etc. Known values are: "Unknown", "DeliveredAsSpam", "Delivered", "Blocked", and
+ "Replaced".
+ :paramtype delivery_action: str or ~azure.mgmt.securityinsight.models.DeliveryAction
+ :keyword delivery_location: The delivery location of this mail message like Inbox, JunkFolder
+ etc. Known values are: "Unknown", "Inbox", "JunkFolder", "DeletedFolder", "Quarantine",
+ "External", "Failed", "Dropped", and "Forwarded".
+ :paramtype delivery_location: str or ~azure.mgmt.securityinsight.models.DeliveryLocation
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "MLBehaviorAnalytics"
- self.alert_rule_template_name = alert_rule_template_name
- self.description = None
- self.display_name = None
- self.enabled = enabled
- self.last_modified_utc = None
- self.severity = None
- self.tactics = None
- self.techniques = None
+ super().__init__(**kwargs)
+ self.file_entity_ids = None
+ self.recipient = None
+ self.urls = None
+ self.threats = None
+ self.p1_sender = None
+ self.p1_sender_display_name = None
+ self.p1_sender_domain = None
+ self.sender_ip = None
+ self.p2_sender = None
+ self.p2_sender_display_name = None
+ self.p2_sender_domain = None
+ self.receive_date = None
+ self.network_message_id = None
+ self.internet_message_id = None
+ self.subject = None
+ self.language = None
+ self.threat_detection_methods = None
+ self.body_fingerprint_bin1 = body_fingerprint_bin1
+ self.body_fingerprint_bin2 = body_fingerprint_bin2
+ self.body_fingerprint_bin3 = body_fingerprint_bin3
+ self.body_fingerprint_bin4 = body_fingerprint_bin4
+ self.body_fingerprint_bin5 = body_fingerprint_bin5
+ self.antispam_direction = antispam_direction
+ self.delivery_action = delivery_action
+ self.delivery_location = delivery_location
-class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents MLBehaviorAnalytics alert rule template.
+class MalwareEntity(Entity):
+ """Represents a malware entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -14797,34 +7869,26 @@ class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disabl
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar category: The malware category by the vendor, e.g. Trojan.
+ :vartype category: str
+ :ivar file_entity_ids: List of linked file entity identifiers on which the malware was found.
+ :vartype file_entity_ids: list[str]
+ :ivar malware_name: The malware name by the vendor, e.g. Win32/Toga!rfn.
+ :vartype malware_name: str
+ :ivar process_entity_ids: List of linked process entity identifiers on which the malware was
+ found.
+ :vartype process_entity_ids: list[str]
"""
_validation = {
@@ -14833,8 +7897,12 @@ class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disabl
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "category": {"readonly": True},
+ "file_entity_ids": {"readonly": True},
+ "malware_name": {"readonly": True},
+ "process_entity_ids": {"readonly": True},
}
_attribute_map = {
@@ -14843,240 +7911,116 @@ class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disabl
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"kind": {"key": "kind", "type": "str"},
- "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "required_data_connectors": {
- "key": "properties.requiredDataConnectors",
- "type": "[AlertRuleTemplateDataSource]",
- },
- "status": {"key": "properties.status", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
- "severity": {"key": "properties.severity", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- """
- super().__init__(**kwargs)
- self.kind: str = "MLBehaviorAnalytics"
- self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.last_updated_date_utc = None
- self.created_date_utc = None
- self.description = description
- self.display_name = display_name
- self.required_data_connectors = required_data_connectors
- self.status = status
- self.tactics = tactics
- self.techniques = techniques
- self.severity = severity
-
-
-class MLBehaviorAnalyticsAlertRuleTemplateProperties(AlertRuleTemplateWithMitreProperties):
- """MLBehaviorAnalytics alert rule template properties.
-
- 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 alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
- :ivar severity: The severity for alerts created by this alert rule. Required. Known values are:
- "High", "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- """
-
- _validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
- "severity": {"required": True},
- }
-
- _attribute_map = {
- "alert_rules_created_by_template_count": {"key": "alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "createdDateUTC", "type": "iso-8601"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "required_data_connectors": {"key": "requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
- "status": {"key": "status", "type": "str"},
- "tactics": {"key": "tactics", "type": "[str]"},
- "techniques": {"key": "techniques", "type": "[str]"},
- "severity": {"key": "severity", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- severity: Union[str, "_models.AlertSeverity"],
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- :keyword severity: The severity for alerts created by this alert rule. Required. Known values
- are: "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- """
- super().__init__(
- alert_rules_created_by_template_count=alert_rules_created_by_template_count,
- description=description,
- display_name=display_name,
- required_data_connectors=required_data_connectors,
- status=status,
- tactics=tactics,
- techniques=techniques,
- **kwargs
- )
- self.severity = severity
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "category": {"key": "properties.category", "type": "str"},
+ "file_entity_ids": {"key": "properties.fileEntityIds", "type": "[str]"},
+ "malware_name": {"key": "properties.malwareName", "type": "str"},
+ "process_entity_ids": {"key": "properties.processEntityIds", "type": "[str]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.kind: str = "Malware"
+ self.additional_data = None
+ self.friendly_name = None
+ self.category = None
+ self.file_entity_ids = None
+ self.malware_name = None
+ self.process_entity_ids = None
-class MSTICheckRequirements(DataConnectorsCheckRequirements):
- """Represents Microsoft Threat Intelligence requirements check request.
+class MalwareEntityProperties(EntityCommonProperties):
+ """Malware entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar category: The malware category by the vendor, e.g. Trojan.
+ :vartype category: str
+ :ivar file_entity_ids: List of linked file entity identifiers on which the malware was found.
+ :vartype file_entity_ids: list[str]
+ :ivar malware_name: The malware name by the vendor, e.g. Win32/Toga!rfn.
+ :vartype malware_name: str
+ :ivar process_entity_ids: List of linked process entity identifiers on which the malware was
+ found.
+ :vartype process_entity_ids: list[str]
"""
_validation = {
- "kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "category": {"readonly": True},
+ "file_entity_ids": {"readonly": True},
+ "malware_name": {"readonly": True},
+ "process_entity_ids": {"readonly": True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "category": {"key": "category", "type": "str"},
+ "file_entity_ids": {"key": "fileEntityIds", "type": "[str]"},
+ "malware_name": {"key": "malwareName", "type": "str"},
+ "process_entity_ids": {"key": "processEntityIds", "type": "[str]"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.kind: str = "MicrosoftThreatIntelligence"
- self.tenant_id = tenant_id
+ self.category = None
+ self.file_entity_ids = None
+ self.malware_name = None
+ self.process_entity_ids = None
-class MSTICheckRequirementsProperties(DataConnectorTenantId):
- """Microsoft Threat Intelligence requirements check properties.
+class ManualTriggerRequestBody(_serialization.Model):
+ """Describes the request body for triggering a playbook on an incident.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :ivar tenant_id: The tenant id of the playbook resource.
:vartype tenant_id: str
+ :ivar logic_apps_resource_id: The resource id of the playbook resource. Required.
+ :vartype logic_apps_resource_id: str
"""
_validation = {
- "tenant_id": {"required": True},
+ "logic_apps_resource_id": {"required": True},
}
_attribute_map = {
"tenant_id": {"key": "tenantId", "type": "str"},
+ "logic_apps_resource_id": {"key": "logicAppsResourceId", "type": "str"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(self, *, logic_apps_resource_id: str, tenant_id: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
+ :keyword tenant_id: The tenant id of the playbook resource.
:paramtype tenant_id: str
+ :keyword logic_apps_resource_id: The resource id of the playbook resource. Required.
+ :paramtype logic_apps_resource_id: str
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.tenant_id = tenant_id
+ self.logic_apps_resource_id = logic_apps_resource_id
-class MSTIDataConnector(DataConnector):
- """Represents Microsoft Threat Intelligence data connector.
+class MCASDataConnector(DataConnector):
+ """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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -15090,16 +8034,14 @@ class MSTIDataConnector(DataConnector):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
:ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
+ :vartype data_types: ~azure.mgmt.securityinsight.models.MCASDataConnectorDataTypes
"""
_validation = {
@@ -15118,7 +8060,7 @@ class MSTIDataConnector(DataConnector):
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "MSTIDataConnectorDataTypes"},
+ "data_types": {"key": "properties.dataTypes", "type": "MCASDataConnectorDataTypes"},
}
def __init__(
@@ -15126,246 +8068,307 @@ def __init__(
*,
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
- data_types: Optional["_models.MSTIDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ data_types: Optional["_models.MCASDataConnectorDataTypes"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
:keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
:keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.MCASDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftThreatIntelligence"
+ self.kind: str = "MicrosoftCloudAppSecurity"
self.tenant_id = tenant_id
self.data_types = data_types
-class MSTIDataConnectorDataTypes(_serialization.Model):
- """The available data types for Microsoft Threat Intelligence Platforms data connector.
-
- All required parameters must be populated in order to send to Azure.
+class MCASDataConnectorDataTypes(AlertsDataTypeOfDataConnector):
+ """The available data types for MCAS (Microsoft Cloud App Security) data connector.
- :ivar bing_safety_phishing_url: Data type for Microsoft Threat Intelligence Platforms data
- connector. Required.
- :vartype bing_safety_phishing_url:
- ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypesBingSafetyPhishingURL
- :ivar microsoft_emerging_threat_feed: Data type for Microsoft Threat Intelligence Platforms
- data connector. Required.
- :vartype microsoft_emerging_threat_feed:
- ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed
+ :ivar alerts: Alerts data type connection.
+ :vartype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
+ :ivar discovery_logs: Discovery log data type connection.
+ :vartype discovery_logs: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
"""
- _validation = {
- "bing_safety_phishing_url": {"required": True},
- "microsoft_emerging_threat_feed": {"required": True},
- }
-
_attribute_map = {
- "bing_safety_phishing_url": {
- "key": "bingSafetyPhishingURL",
- "type": "MSTIDataConnectorDataTypesBingSafetyPhishingURL",
- },
- "microsoft_emerging_threat_feed": {
- "key": "microsoftEmergingThreatFeed",
- "type": "MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
- },
+ "alerts": {"key": "alerts", "type": "DataConnectorDataTypeCommon"},
+ "discovery_logs": {"key": "discoveryLogs", "type": "DataConnectorDataTypeCommon"},
}
def __init__(
self,
*,
- bing_safety_phishing_url: "_models.MSTIDataConnectorDataTypesBingSafetyPhishingURL",
- microsoft_emerging_threat_feed: "_models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
- **kwargs
- ):
+ alerts: Optional["_models.DataConnectorDataTypeCommon"] = None,
+ discovery_logs: Optional["_models.DataConnectorDataTypeCommon"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword bing_safety_phishing_url: Data type for Microsoft Threat Intelligence Platforms data
- connector. Required.
- :paramtype bing_safety_phishing_url:
- ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypesBingSafetyPhishingURL
- :keyword microsoft_emerging_threat_feed: Data type for Microsoft Threat Intelligence Platforms
- data connector. Required.
- :paramtype microsoft_emerging_threat_feed:
- ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed
+ :keyword alerts: Alerts data type connection.
+ :paramtype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
+ :keyword discovery_logs: Discovery log data type connection.
+ :paramtype discovery_logs: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
"""
- super().__init__(**kwargs)
- self.bing_safety_phishing_url = bing_safety_phishing_url
- self.microsoft_emerging_threat_feed = microsoft_emerging_threat_feed
+ super().__init__(alerts=alerts, **kwargs)
+ self.discovery_logs = discovery_logs
-class MSTIDataConnectorDataTypesBingSafetyPhishingURL(DataConnectorDataTypeCommon):
- """Data type for Microsoft Threat Intelligence Platforms data connector.
+class MDATPDataConnector(DataConnector):
+ """Represents MDATP (Microsoft Defender Advanced Threat Protection) 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.
+ All required parameters must be populated in order to send to server.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- :ivar lookback_period: lookback period. Required.
- :vartype lookback_period: str
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
+ :ivar tenant_id: The tenant id to connect to, and get the data from.
+ :vartype tenant_id: str
+ :ivar data_types: The available data types for the connector.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
"""
_validation = {
- "state": {"required": True},
- "lookback_period": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
}
_attribute_map = {
- "state": {"key": "state", "type": "str"},
- "lookback_period": {"key": "lookbackPeriod", "type": "str"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], lookback_period: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- :keyword lookback_period: lookback period. Required.
- :paramtype lookback_period: str
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
"""
- super().__init__(state=state, **kwargs)
- self.lookback_period = lookback_period
-
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = "MicrosoftDefenderAdvancedThreatProtection"
+ self.tenant_id = tenant_id
+ self.data_types = data_types
-class MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed(DataConnectorDataTypeCommon):
- """Data type for Microsoft Threat Intelligence Platforms data connector.
- All required parameters must be populated in order to send to Azure.
+class MetadataAuthor(_serialization.Model):
+ """Publisher or creator of the content item.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- :ivar lookback_period: lookback period. Required.
- :vartype lookback_period: str
+ :ivar name: Name of the author. Company or person.
+ :vartype name: str
+ :ivar email: Email of author contact.
+ :vartype email: str
+ :ivar link: Link for author/vendor page.
+ :vartype link: str
"""
- _validation = {
- "state": {"required": True},
- "lookback_period": {"required": True},
- }
-
_attribute_map = {
- "state": {"key": "state", "type": "str"},
- "lookback_period": {"key": "lookbackPeriod", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "email": {"key": "email", "type": "str"},
+ "link": {"key": "link", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], lookback_period: str, **kwargs):
+ def __init__(
+ self, *, name: Optional[str] = None, email: Optional[str] = None, link: Optional[str] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- :keyword lookback_period: lookback period. Required.
- :paramtype lookback_period: str
+ :keyword name: Name of the author. Company or person.
+ :paramtype name: str
+ :keyword email: Email of author contact.
+ :paramtype email: str
+ :keyword link: Link for author/vendor page.
+ :paramtype link: str
"""
- super().__init__(state=state, **kwargs)
- self.lookback_period = lookback_period
-
+ super().__init__(**kwargs)
+ self.name = name
+ self.email = email
+ self.link = link
-class MSTIDataConnectorProperties(DataConnectorTenantId):
- """Microsoft Threat Intelligence data connector properties.
- All required parameters must be populated in order to send to Azure.
+class MetadataCategories(_serialization.Model):
+ """ies for the solution content item.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
+ :ivar domains: domain for the solution content item.
+ :vartype domains: list[str]
+ :ivar verticals: Industry verticals for the solution content item.
+ :vartype verticals: list[str]
"""
- _validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
- }
-
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "MSTIDataConnectorDataTypes"},
+ "domains": {"key": "domains", "type": "[str]"},
+ "verticals": {"key": "verticals", "type": "[str]"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.MSTIDataConnectorDataTypes", **kwargs):
+ def __init__(
+ self, *, domains: Optional[List[str]] = None, verticals: Optional[List[str]] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
+ :keyword domains: domain for the solution content item.
+ :paramtype domains: list[str]
+ :keyword verticals: Industry verticals for the solution content item.
+ :paramtype verticals: list[str]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.domains = domains
+ self.verticals = verticals
-class MtpCheckRequirements(DataConnectorsCheckRequirements):
- """Represents MTP (Microsoft Threat Protection) requirements check request.
- All required parameters must be populated in order to send to Azure.
+class MetadataDependencies(_serialization.Model):
+ """Dependencies for the content item, what other content items it requires to work. Can describe
+ more complex dependencies using a recursive/nested structure. For a single dependency an
+ id/kind/version can be supplied or operator/criteria for complex dependencies.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
+ :ivar content_id: Id of the content item we depend on.
+ :vartype content_id: str
+ :ivar kind: Type of the content item we depend on. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :ivar version: Version of the the content item we depend on. Can be blank, * or missing to
+ indicate any version fulfills the dependency. If version does not match our defined numeric
+ format then an exact match is required.
+ :vartype version: str
+ :ivar name: Name of the content item.
+ :vartype name: str
+ :ivar operator: Operator used for list of dependencies in criteria array. Known values are:
+ "AND", "OR", "AND", and "OR".
+ :vartype operator: str or ~azure.mgmt.securityinsight.models.Operator
+ :ivar criteria: This is the list of dependencies we must fulfill, according to the AND/OR
+ operator.
+ :vartype criteria: list[~azure.mgmt.securityinsight.models.MetadataDependencies]
"""
- _validation = {
- "kind": {"required": True},
- }
-
_attribute_map = {
+ "content_id": {"key": "contentId", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "operator": {"key": "operator", "type": "str"},
+ "criteria": {"key": "criteria", "type": "[MetadataDependencies]"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ content_id: Optional[str] = None,
+ kind: Optional[Union[str, "_models.Kind"]] = None,
+ version: Optional[str] = None,
+ name: Optional[str] = None,
+ operator: Optional[Union[str, "_models.Operator"]] = None,
+ criteria: Optional[List["_models.MetadataDependencies"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword content_id: Id of the content item we depend on.
+ :paramtype content_id: str
+ :keyword kind: Type of the content item we depend on. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :paramtype kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :keyword version: Version of the the content item we depend on. Can be blank, * or missing to
+ indicate any version fulfills the dependency. If version does not match our defined numeric
+ format then an exact match is required.
+ :paramtype version: str
+ :keyword name: Name of the content item.
+ :paramtype name: str
+ :keyword operator: Operator used for list of dependencies in criteria array. Known values are:
+ "AND", "OR", "AND", and "OR".
+ :paramtype operator: str or ~azure.mgmt.securityinsight.models.Operator
+ :keyword criteria: This is the list of dependencies we must fulfill, according to the AND/OR
+ operator.
+ :paramtype criteria: list[~azure.mgmt.securityinsight.models.MetadataDependencies]
"""
super().__init__(**kwargs)
- self.kind: str = "MicrosoftThreatProtection"
- self.tenant_id = tenant_id
+ self.content_id = content_id
+ self.kind = kind
+ self.version = version
+ self.name = name
+ self.operator = operator
+ self.criteria = criteria
-class MTPCheckRequirementsProperties(DataConnectorTenantId):
- """MTP (Microsoft Threat Protection) requirements check properties.
+class MetadataList(_serialization.Model):
+ """List of all the metadata.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar value: Array of metadata. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.MetadataModel]
+ :ivar next_link: URL to fetch the next page of metadata.
+ :vartype next_link: str
"""
_validation = {
- "tenant_id": {"required": True},
+ "value": {"required": True},
+ "next_link": {"readonly": True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "value": {"key": "value", "type": "[MetadataModel]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(self, *, value: List["_models.MetadataModel"], **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword value: Array of metadata. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.MetadataModel]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
-class MTPDataConnector(DataConnector):
- """Represents MTP (Microsoft Threat Protection) data connector.
+class MetadataModel(ResourceWithEtag):
+ """Metadata resource definition.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -15377,18 +8380,55 @@ class MTPDataConnector(DataConnector):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypes
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar parent_id: Full parent resource ID of the content item the metadata is for. This is the
+ full resource ID including the scope (subscription and resource group).
+ :vartype parent_id: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar kind: The kind of content the metadata is for.
+ :vartype kind: str
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the metadata - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the solution content item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the solution content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date solution content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the solution content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the solution template.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
"""
_validation = {
@@ -15396,7 +8436,6 @@ class MTPDataConnector(DataConnector):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
}
_attribute_map = {
@@ -15405,245 +8444,411 @@ class MTPDataConnector(DataConnector):
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "MTPDataConnectorDataTypes"},
+ "content_id": {"key": "properties.contentId", "type": "str"},
+ "parent_id": {"key": "properties.parentId", "type": "str"},
+ "version": {"key": "properties.version", "type": "str"},
+ "kind": {"key": "properties.kind", "type": "str"},
+ "source": {"key": "properties.source", "type": "MetadataSource"},
+ "author": {"key": "properties.author", "type": "MetadataAuthor"},
+ "support": {"key": "properties.support", "type": "MetadataSupport"},
+ "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "properties.categories", "type": "MetadataCategories"},
+ "providers": {"key": "properties.providers", "type": "[str]"},
+ "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
+ "custom_version": {"key": "properties.customVersion", "type": "str"},
+ "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
+ "icon": {"key": "properties.icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "properties.previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "properties.previewImagesDark", "type": "[str]"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.MTPDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ content_id: Optional[str] = None,
+ parent_id: Optional[str] = None,
+ version: Optional[str] = None,
+ kind: Optional[str] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypes
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftThreatProtection"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
-
-class MTPDataConnectorDataTypes(_serialization.Model):
- """The available data types for Microsoft Threat Protection Platforms data connector.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar incidents: Data type for Microsoft Threat Protection Platforms data connector. Required.
- :vartype incidents: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesIncidents
- """
-
- _validation = {
- "incidents": {"required": True},
- }
-
- _attribute_map = {
- "incidents": {"key": "incidents", "type": "MTPDataConnectorDataTypesIncidents"},
- }
-
- def __init__(self, *, incidents: "_models.MTPDataConnectorDataTypesIncidents", **kwargs):
- """
- :keyword incidents: Data type for Microsoft Threat Protection Platforms data connector.
- Required.
- :paramtype incidents: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesIncidents
- """
- super().__init__(**kwargs)
- self.incidents = incidents
-
-
-class MTPDataConnectorDataTypesIncidents(DataConnectorDataTypeCommon):
- """Data type for Microsoft Threat Protection Platforms data connector.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
-
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword parent_id: Full parent resource ID of the content item the metadata is for. This is
+ the full resource ID including the scope (subscription and resource group).
+ :paramtype parent_id: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword kind: The kind of content the metadata is for.
+ :paramtype kind: str
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the metadata - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the solution content item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the solution content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date solution content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the solution content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the solution template.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
"""
- super().__init__(state=state, **kwargs)
-
+ super().__init__(etag=etag, **kwargs)
+ self.content_id = content_id
+ self.parent_id = parent_id
+ self.version = version
+ self.kind = kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
-class MTPDataConnectorProperties(DataConnectorTenantId):
- """MTP (Microsoft Threat Protection) data connector properties.
- All required parameters must be populated in order to send to Azure.
+class MetadataPatch(_serialization.Model):
+ """Metadata patch request body.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypes
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar parent_id: Full parent resource ID of the content item the metadata is for. This is the
+ full resource ID including the scope (subscription and resource group).
+ :vartype parent_id: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar kind: The kind of content the metadata is for.
+ :vartype kind: str
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the metadata - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the solution content item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the solution content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date solution content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the solution content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the solution template.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
"""
- _validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
- }
-
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "MTPDataConnectorDataTypes"},
+ "content_id": {"key": "properties.contentId", "type": "str"},
+ "parent_id": {"key": "properties.parentId", "type": "str"},
+ "version": {"key": "properties.version", "type": "str"},
+ "kind": {"key": "properties.kind", "type": "str"},
+ "source": {"key": "properties.source", "type": "MetadataSource"},
+ "author": {"key": "properties.author", "type": "MetadataAuthor"},
+ "support": {"key": "properties.support", "type": "MetadataSupport"},
+ "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "properties.categories", "type": "MetadataCategories"},
+ "providers": {"key": "properties.providers", "type": "[str]"},
+ "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
+ "custom_version": {"key": "properties.customVersion", "type": "str"},
+ "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
+ "icon": {"key": "properties.icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "properties.previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "properties.previewImagesDark", "type": "[str]"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.MTPDataConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ content_id: Optional[str] = None,
+ parent_id: Optional[str] = None,
+ version: Optional[str] = None,
+ kind: Optional[str] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypes
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword parent_id: Full parent resource ID of the content item the metadata is for. This is
+ the full resource ID including the scope (subscription and resource group).
+ :paramtype parent_id: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword kind: The kind of content the metadata is for.
+ :paramtype kind: str
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the metadata - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the solution content item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the solution content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date solution content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the solution content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the solution template.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.content_id = content_id
+ self.parent_id = parent_id
+ self.version = version
+ self.kind = kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
-class NicEntity(Entity):
- """Represents an network interface entity.
- Variables are only populated by the server, and will be ignored when sending a request.
+class MetadataSource(_serialization.Model):
+ """The original source of the content item, where it comes from.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
+ :ivar kind: Source type of the content. Required. Known values are: "LocalWorkspace",
+ "Community", "Solution", and "SourceRepository".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.SourceKind
+ :ivar name: Name of the content source. The repo name, solution name, LA workspace name etc.
:vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar mac_address: The MAC address of this network interface.
- :vartype mac_address: str
- :ivar ip_address_entity_id: The IP entity id of this network interface.
- :vartype ip_address_entity_id: str
- :ivar vlans: A list of VLANs of the network interface entity.
- :vartype vlans: list[str]
+ :ivar source_id: ID of the content source. The solution ID, workspace ID, etc.
+ :vartype source_id: str
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
"kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "mac_address": {"readonly": True},
- "ip_address_entity_id": {"readonly": True},
- "vlans": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
"kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "mac_address": {"key": "properties.macAddress", "type": "str"},
- "ip_address_entity_id": {"key": "properties.ipAddressEntityId", "type": "str"},
- "vlans": {"key": "properties.vlans", "type": "[str]"},
+ "name": {"key": "name", "type": "str"},
+ "source_id": {"key": "sourceId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ kind: Union[str, "_models.SourceKind"],
+ name: Optional[str] = None,
+ source_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword kind: Source type of the content. Required. Known values are: "LocalWorkspace",
+ "Community", "Solution", and "SourceRepository".
+ :paramtype kind: str or ~azure.mgmt.securityinsight.models.SourceKind
+ :keyword name: Name of the content source. The repo name, solution name, LA workspace name
+ etc.
+ :paramtype name: str
+ :keyword source_id: ID of the content source. The solution ID, workspace ID, etc.
+ :paramtype source_id: str
+ """
super().__init__(**kwargs)
- self.kind: str = "Nic"
- self.additional_data = None
- self.friendly_name = None
- self.mac_address = None
- self.ip_address_entity_id = None
- self.vlans = None
+ self.kind = kind
+ self.name = name
+ self.source_id = source_id
-class NicEntityProperties(EntityCommonProperties):
- """Nic entity property bag.
+class MetadataSupport(_serialization.Model):
+ """Support information for the content item.
- 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 server.
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar mac_address: The MAC address of this network interface.
- :vartype mac_address: str
- :ivar ip_address_entity_id: The IP entity id of this network interface.
- :vartype ip_address_entity_id: str
- :ivar vlans: A list of VLANs of the network interface entity.
- :vartype vlans: list[str]
+ :ivar tier: Type of support for content item. Required. Known values are: "Microsoft",
+ "Partner", and "Community".
+ :vartype tier: str or ~azure.mgmt.securityinsight.models.SupportTier
+ :ivar name: Name of the support contact. Company or person.
+ :vartype name: str
+ :ivar email: Email of support contact.
+ :vartype email: str
+ :ivar link: Link for support help, like to support page to open a ticket etc.
+ :vartype link: str
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "mac_address": {"readonly": True},
- "ip_address_entity_id": {"readonly": True},
- "vlans": {"readonly": True},
+ "tier": {"required": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "mac_address": {"key": "macAddress", "type": "str"},
- "ip_address_entity_id": {"key": "ipAddressEntityId", "type": "str"},
- "vlans": {"key": "vlans", "type": "[str]"},
+ "tier": {"key": "tier", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "email": {"key": "email", "type": "str"},
+ "link": {"key": "link", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ tier: Union[str, "_models.SupportTier"],
+ name: Optional[str] = None,
+ email: Optional[str] = None,
+ link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword tier: Type of support for content item. Required. Known values are: "Microsoft",
+ "Partner", and "Community".
+ :paramtype tier: str or ~azure.mgmt.securityinsight.models.SupportTier
+ :keyword name: Name of the support contact. Company or person.
+ :paramtype name: str
+ :keyword email: Email of support contact.
+ :paramtype email: str
+ :keyword link: Link for support help, like to support page to open a ticket etc.
+ :paramtype link: str
+ """
super().__init__(**kwargs)
- self.mac_address = None
- self.ip_address_entity_id = None
- self.vlans = None
+ self.tier = tier
+ self.name = name
+ self.email = email
+ self.link = link
-class NrtAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents NRT alert rule.
+class MicrosoftSecurityIncidentCreationAlertRule(AlertRule): # pylint: disable=name-too-long
+ """Represents MicrosoftSecurityIncidentCreation rule.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -15655,53 +8860,30 @@ class NrtAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
:vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
+ :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :vartype display_names_filter: list[str]
+ :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :vartype display_names_exclude_filter: list[str]
+ :ivar product_filter: The alerts' productName on which the cases will be generated. Known
+ values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
+ Protection", "Azure Active Directory Identity Protection", and "Azure Security Center for IoT".
+ :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :ivar severities_filter: the alerts' severities on which the cases will be generated.
+ :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
:ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
:vartype alert_rule_template_name: str
- :ivar template_version: The version of the alert rule template used to create this rule - in
- format , where all are numbers, for example 0 <1.0.2>.
- :vartype template_version: str
:ivar description: The description of the alert rule.
:vartype description: str
- :ivar query: The query that creates alerts for this rule.
- :vartype query: str
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
:ivar display_name: The display name for alerts created by this alert rule.
:vartype display_name: str
:ivar enabled: Determines whether this alert rule is enabled or disabled.
:vartype enabled: bool
- :ivar last_modified_utc: The last time that this alert rule has been modified.
+ :ivar last_modified_utc: The last time that this alert has been modified.
:vartype last_modified_utc: ~datetime.datetime
- :ivar suppression_duration: The suppression (in ISO 8601 duration format) to wait since last
- time this alert rule been triggered.
- :vartype suppression_duration: ~datetime.timedelta
- :ivar suppression_enabled: Determines whether the suppression for this alert rule is enabled or
- disabled.
- :vartype suppression_enabled: bool
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar incident_configuration: The settings of the incidents that created from alerts triggered
- by this analytics rule.
- :vartype incident_configuration: ~azure.mgmt.securityinsight.models.IncidentConfiguration
- :ivar custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :vartype custom_details: dict[str, str]
- :ivar entity_mappings: Array of the entity mappings of the alert rule.
- :vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :ivar alert_details_override: The alert details override settings.
- :vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar event_grouping_settings: The event grouping settings.
- :vartype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
_validation = {
@@ -15720,498 +8902,331 @@ class NrtAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
+ "display_names_filter": {"key": "properties.displayNamesFilter", "type": "[str]"},
+ "display_names_exclude_filter": {"key": "properties.displayNamesExcludeFilter", "type": "[str]"},
+ "product_filter": {"key": "properties.productFilter", "type": "str"},
+ "severities_filter": {"key": "properties.severitiesFilter", "type": "[str]"},
"alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
- "template_version": {"key": "properties.templateVersion", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
- "query": {"key": "properties.query", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
"display_name": {"key": "properties.displayName", "type": "str"},
"enabled": {"key": "properties.enabled", "type": "bool"},
"last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
- "suppression_duration": {"key": "properties.suppressionDuration", "type": "duration"},
- "suppression_enabled": {"key": "properties.suppressionEnabled", "type": "bool"},
- "severity": {"key": "properties.severity", "type": "str"},
- "incident_configuration": {"key": "properties.incidentConfiguration", "type": "IncidentConfiguration"},
- "custom_details": {"key": "properties.customDetails", "type": "{str}"},
- "entity_mappings": {"key": "properties.entityMappings", "type": "[EntityMapping]"},
- "alert_details_override": {"key": "properties.alertDetailsOverride", "type": "AlertDetailsOverride"},
- "event_grouping_settings": {"key": "properties.eventGroupingSettings", "type": "EventGroupingSettings"},
- "sentinel_entities_mappings": {"key": "properties.sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
self,
*,
etag: Optional[str] = None,
+ display_names_filter: Optional[List[str]] = None,
+ display_names_exclude_filter: Optional[List[str]] = None,
+ product_filter: Optional[Union[str, "_models.MicrosoftSecurityProductName"]] = None,
+ severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
alert_rule_template_name: Optional[str] = None,
- template_version: Optional[str] = None,
description: Optional[str] = None,
- query: Optional[str] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
display_name: Optional[str] = None,
enabled: Optional[bool] = None,
- suppression_duration: Optional[datetime.timedelta] = None,
- suppression_enabled: Optional[bool] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- incident_configuration: Optional["_models.IncidentConfiguration"] = None,
- custom_details: Optional[Dict[str, str]] = None,
- entity_mappings: Optional[List["_models.EntityMapping"]] = None,
- alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- event_grouping_settings: Optional["_models.EventGroupingSettings"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
+ :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :paramtype display_names_filter: list[str]
+ :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :paramtype display_names_exclude_filter: list[str]
+ :keyword product_filter: The alerts' productName on which the cases will be generated. Known
+ values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
+ Protection", "Azure Active Directory Identity Protection", and "Azure Security Center for IoT".
+ :paramtype product_filter: str or
+ ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :keyword severities_filter: the alerts' severities on which the cases will be generated.
+ :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
:keyword alert_rule_template_name: The Name of the alert rule template used to create this
rule.
:paramtype alert_rule_template_name: str
- :keyword template_version: The version of the alert rule template used to create this rule - in
- format , where all are numbers, for example 0 <1.0.2>.
- :paramtype template_version: str
:keyword description: The description of the alert rule.
:paramtype description: str
- :keyword query: The query that creates alerts for this rule.
- :paramtype query: str
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
:keyword display_name: The display name for alerts created by this alert rule.
:paramtype display_name: str
:keyword enabled: Determines whether this alert rule is enabled or disabled.
:paramtype enabled: bool
- :keyword suppression_duration: The suppression (in ISO 8601 duration format) to wait since last
- time this alert rule been triggered.
- :paramtype suppression_duration: ~datetime.timedelta
- :keyword suppression_enabled: Determines whether the suppression for this alert rule is enabled
- or disabled.
- :paramtype suppression_enabled: bool
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword incident_configuration: The settings of the incidents that created from alerts
- triggered by this analytics rule.
- :paramtype incident_configuration: ~azure.mgmt.securityinsight.models.IncidentConfiguration
- :keyword custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :paramtype custom_details: dict[str, str]
- :keyword entity_mappings: Array of the entity mappings of the alert rule.
- :paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :keyword alert_details_override: The alert details override settings.
- :paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword event_grouping_settings: The event grouping settings.
- :paramtype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "NRT"
+ self.kind: str = "MicrosoftSecurityIncidentCreation"
+ self.display_names_filter = display_names_filter
+ self.display_names_exclude_filter = display_names_exclude_filter
+ self.product_filter = product_filter
+ self.severities_filter = severities_filter
self.alert_rule_template_name = alert_rule_template_name
- self.template_version = template_version
self.description = description
- self.query = query
- self.tactics = tactics
- self.techniques = techniques
self.display_name = display_name
self.enabled = enabled
self.last_modified_utc = None
- self.suppression_duration = suppression_duration
- self.suppression_enabled = suppression_enabled
- self.severity = severity
- self.incident_configuration = incident_configuration
- self.custom_details = custom_details
- self.entity_mappings = entity_mappings
- self.alert_details_override = alert_details_override
- self.event_grouping_settings = event_grouping_settings
- self.sentinel_entities_mappings = sentinel_entities_mappings
-
-class NrtAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents NRT alert rule template.
- Variables are only populated by the server, and will be ignored when sending a request.
+class MicrosoftSecurityIncidentCreationAlertRuleCommonProperties(_serialization.Model): # pylint: disable=name-too-long
+ """MicrosoftSecurityIncidentCreation rule common property bag.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
- :ivar query: The query that creates alerts for this rule.
- :vartype query: str
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar version: The version of this template - in format , where all are numbers. For
- example <1.0.2>.
- :vartype version: str
- :ivar custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :vartype custom_details: dict[str, str]
- :ivar entity_mappings: Array of the entity mappings of the alert rule.
- :vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :ivar alert_details_override: The alert details override settings.
- :vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar event_grouping_settings: The event grouping settings.
- :vartype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
+ :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :vartype display_names_filter: list[str]
+ :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :vartype display_names_exclude_filter: list[str]
+ :ivar product_filter: The alerts' productName on which the cases will be generated. Required.
+ Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced
+ Threat Protection", "Azure Active Directory Identity Protection", and "Azure Security Center
+ for IoT".
+ :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :ivar severities_filter: the alerts' severities on which the cases will be generated.
+ :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ "product_filter": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "required_data_connectors": {
- "key": "properties.requiredDataConnectors",
- "type": "[AlertRuleTemplateDataSource]",
- },
- "status": {"key": "properties.status", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
- "query": {"key": "properties.query", "type": "str"},
- "severity": {"key": "properties.severity", "type": "str"},
- "version": {"key": "properties.version", "type": "str"},
- "custom_details": {"key": "properties.customDetails", "type": "{str}"},
- "entity_mappings": {"key": "properties.entityMappings", "type": "[EntityMapping]"},
- "alert_details_override": {"key": "properties.alertDetailsOverride", "type": "AlertDetailsOverride"},
- "event_grouping_settings": {"key": "properties.eventGroupingSettings", "type": "EventGroupingSettings"},
- "sentinel_entities_mappings": {"key": "properties.sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
+ "display_names_filter": {"key": "displayNamesFilter", "type": "[str]"},
+ "display_names_exclude_filter": {"key": "displayNamesExcludeFilter", "type": "[str]"},
+ "product_filter": {"key": "productFilter", "type": "str"},
+ "severities_filter": {"key": "severitiesFilter", "type": "[str]"},
}
def __init__(
self,
*,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- query: Optional[str] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- version: Optional[str] = None,
- custom_details: Optional[Dict[str, str]] = None,
- entity_mappings: Optional[List["_models.EntityMapping"]] = None,
- alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- event_grouping_settings: Optional["_models.EventGroupingSettings"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
- **kwargs
- ):
+ product_filter: Union[str, "_models.MicrosoftSecurityProductName"],
+ display_names_filter: Optional[List[str]] = None,
+ display_names_exclude_filter: Optional[List[str]] = None,
+ severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- :keyword query: The query that creates alerts for this rule.
- :paramtype query: str
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword version: The version of this template - in format , where all are numbers. For
- example <1.0.2>.
- :paramtype version: str
- :keyword custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :paramtype custom_details: dict[str, str]
- :keyword entity_mappings: Array of the entity mappings of the alert rule.
- :paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :keyword alert_details_override: The alert details override settings.
- :paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword event_grouping_settings: The event grouping settings.
- :paramtype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
+ :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :paramtype display_names_filter: list[str]
+ :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :paramtype display_names_exclude_filter: list[str]
+ :keyword product_filter: The alerts' productName on which the cases will be generated.
+ Required. Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure
+ Advanced Threat Protection", "Azure Active Directory Identity Protection", and "Azure Security
+ Center for IoT".
+ :paramtype product_filter: str or
+ ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :keyword severities_filter: the alerts' severities on which the cases will be generated.
+ :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
"""
super().__init__(**kwargs)
- self.kind: str = "NRT"
- self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.last_updated_date_utc = None
- self.created_date_utc = None
- self.description = description
- self.display_name = display_name
- self.required_data_connectors = required_data_connectors
- self.status = status
- self.tactics = tactics
- self.techniques = techniques
- self.query = query
- self.severity = severity
- self.version = version
- self.custom_details = custom_details
- self.entity_mappings = entity_mappings
- self.alert_details_override = alert_details_override
- self.event_grouping_settings = event_grouping_settings
- self.sentinel_entities_mappings = sentinel_entities_mappings
+ self.display_names_filter = display_names_filter
+ self.display_names_exclude_filter = display_names_exclude_filter
+ self.product_filter = product_filter
+ self.severities_filter = severities_filter
-class QueryBasedAlertRuleTemplateProperties(_serialization.Model):
- """Query based alert rule template base property bag.
+class MicrosoftSecurityIncidentCreationAlertRuleProperties(
+ MicrosoftSecurityIncidentCreationAlertRuleCommonProperties
+): # pylint: disable=name-too-long
+ """MicrosoftSecurityIncidentCreation rule property bag.
- :ivar query: The query that creates alerts for this rule.
- :vartype query: str
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar version: The version of this template - in format , where all are numbers. For
- example <1.0.2>.
- :vartype version: str
- :ivar custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :vartype custom_details: dict[str, str]
- :ivar entity_mappings: Array of the entity mappings of the alert rule.
- :vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :ivar alert_details_override: The alert details override settings.
- :vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar event_grouping_settings: The event grouping settings.
- :vartype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
+ 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 server.
+
+ :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :vartype display_names_filter: list[str]
+ :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :vartype display_names_exclude_filter: list[str]
+ :ivar product_filter: The alerts' productName on which the cases will be generated. Required.
+ Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced
+ Threat Protection", "Azure Active Directory Identity Protection", and "Azure Security Center
+ for IoT".
+ :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :ivar severities_filter: the alerts' severities on which the cases will be generated.
+ :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
+ :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
+ :vartype alert_rule_template_name: str
+ :ivar description: The description of the alert rule.
+ :vartype description: str
+ :ivar display_name: The display name for alerts created by this alert rule. Required.
+ :vartype display_name: str
+ :ivar enabled: Determines whether this alert rule is enabled or disabled. Required.
+ :vartype enabled: bool
+ :ivar last_modified_utc: The last time that this alert has been modified.
+ :vartype last_modified_utc: ~datetime.datetime
"""
+ _validation = {
+ "product_filter": {"required": True},
+ "display_name": {"required": True},
+ "enabled": {"required": True},
+ "last_modified_utc": {"readonly": True},
+ }
+
_attribute_map = {
- "query": {"key": "query", "type": "str"},
- "severity": {"key": "severity", "type": "str"},
- "version": {"key": "version", "type": "str"},
- "custom_details": {"key": "customDetails", "type": "{str}"},
- "entity_mappings": {"key": "entityMappings", "type": "[EntityMapping]"},
- "alert_details_override": {"key": "alertDetailsOverride", "type": "AlertDetailsOverride"},
- "event_grouping_settings": {"key": "eventGroupingSettings", "type": "EventGroupingSettings"},
- "sentinel_entities_mappings": {"key": "sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
+ "display_names_filter": {"key": "displayNamesFilter", "type": "[str]"},
+ "display_names_exclude_filter": {"key": "displayNamesExcludeFilter", "type": "[str]"},
+ "product_filter": {"key": "productFilter", "type": "str"},
+ "severities_filter": {"key": "severitiesFilter", "type": "[str]"},
+ "alert_rule_template_name": {"key": "alertRuleTemplateName", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "enabled": {"key": "enabled", "type": "bool"},
+ "last_modified_utc": {"key": "lastModifiedUtc", "type": "iso-8601"},
}
def __init__(
self,
*,
- query: Optional[str] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- version: Optional[str] = None,
- custom_details: Optional[Dict[str, str]] = None,
- entity_mappings: Optional[List["_models.EntityMapping"]] = None,
- alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- event_grouping_settings: Optional["_models.EventGroupingSettings"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
- **kwargs
- ):
+ product_filter: Union[str, "_models.MicrosoftSecurityProductName"],
+ display_name: str,
+ enabled: bool,
+ display_names_filter: Optional[List[str]] = None,
+ display_names_exclude_filter: Optional[List[str]] = None,
+ severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
+ alert_rule_template_name: Optional[str] = None,
+ description: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword query: The query that creates alerts for this rule.
- :paramtype query: str
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword version: The version of this template - in format , where all are numbers. For
- example <1.0.2>.
- :paramtype version: str
- :keyword custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :paramtype custom_details: dict[str, str]
- :keyword entity_mappings: Array of the entity mappings of the alert rule.
- :paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :keyword alert_details_override: The alert details override settings.
- :paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword event_grouping_settings: The event grouping settings.
- :paramtype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
+ :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :paramtype display_names_filter: list[str]
+ :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :paramtype display_names_exclude_filter: list[str]
+ :keyword product_filter: The alerts' productName on which the cases will be generated.
+ Required. Known values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure
+ Advanced Threat Protection", "Azure Active Directory Identity Protection", and "Azure Security
+ Center for IoT".
+ :paramtype product_filter: str or
+ ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :keyword severities_filter: the alerts' severities on which the cases will be generated.
+ :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
+ :keyword alert_rule_template_name: The Name of the alert rule template used to create this
+ rule.
+ :paramtype alert_rule_template_name: str
+ :keyword description: The description of the alert rule.
+ :paramtype description: str
+ :keyword display_name: The display name for alerts created by this alert rule. Required.
+ :paramtype display_name: str
+ :keyword enabled: Determines whether this alert rule is enabled or disabled. Required.
+ :paramtype enabled: bool
"""
- super().__init__(**kwargs)
- self.query = query
- self.severity = severity
- self.version = version
- self.custom_details = custom_details
- self.entity_mappings = entity_mappings
- self.alert_details_override = alert_details_override
- self.event_grouping_settings = event_grouping_settings
- self.sentinel_entities_mappings = sentinel_entities_mappings
+ super().__init__(
+ display_names_filter=display_names_filter,
+ display_names_exclude_filter=display_names_exclude_filter,
+ product_filter=product_filter,
+ severities_filter=severities_filter,
+ **kwargs
+ )
+ self.alert_rule_template_name = alert_rule_template_name
+ self.description = description
+ self.display_name = display_name
+ self.enabled = enabled
+ self.last_modified_utc = None
-class NrtAlertRuleTemplateProperties(
- AlertRuleTemplateWithMitreProperties, QueryBasedAlertRuleTemplateProperties
-): # pylint: disable=too-many-instance-attributes
- """NRT alert rule template properties.
+class MicrosoftSecurityIncidentCreationAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=name-too-long
+ """Represents MicrosoftSecurityIncidentCreation rule template.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar query: The query that creates alerts for this rule.
- :vartype query: str
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar version: The version of this template - in format , where all are numbers. For
- example <1.0.2>.
- :vartype version: str
- :ivar custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :vartype custom_details: dict[str, str]
- :ivar entity_mappings: Array of the entity mappings of the alert rule.
- :vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :ivar alert_details_override: The alert details override settings.
- :vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar event_grouping_settings: The event grouping settings.
- :vartype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
:ivar alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
:vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
:ivar created_date_utc: The time that this alert rule template has been added.
:vartype created_date_utc: ~datetime.datetime
+ :ivar last_updated_date_utc: The time that this alert rule template was last updated.
+ :vartype last_updated_date_utc: ~datetime.datetime
:ivar description: The description of the alert rule template.
:vartype description: str
:ivar display_name: The display name for alert rule template.
:vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
+ :ivar required_data_connectors: The required data connectors for this template.
:vartype required_data_connectors:
list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
:ivar status: The alert rule template status. Known values are: "Installed", "Available", and
"NotAvailable".
:vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
+ :ivar display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :vartype display_names_filter: list[str]
+ :ivar display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :vartype display_names_exclude_filter: list[str]
+ :ivar product_filter: The alerts' productName on which the cases will be generated. Known
+ values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
+ Protection", "Azure Active Directory Identity Protection", and "Azure Security Center for IoT".
+ :vartype product_filter: str or ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :ivar severities_filter: the alerts' severities on which the cases will be generated.
+ :vartype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
"""
_validation = {
- "last_updated_date_utc": {"readonly": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
"created_date_utc": {"readonly": True},
+ "last_updated_date_utc": {"readonly": True},
}
_attribute_map = {
- "query": {"key": "query", "type": "str"},
- "severity": {"key": "severity", "type": "str"},
- "version": {"key": "version", "type": "str"},
- "custom_details": {"key": "customDetails", "type": "{str}"},
- "entity_mappings": {"key": "entityMappings", "type": "[EntityMapping]"},
- "alert_details_override": {"key": "alertDetailsOverride", "type": "AlertDetailsOverride"},
- "event_grouping_settings": {"key": "eventGroupingSettings", "type": "EventGroupingSettings"},
- "sentinel_entities_mappings": {"key": "sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
- "alert_rules_created_by_template_count": {"key": "alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "createdDateUTC", "type": "iso-8601"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "required_data_connectors": {"key": "requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
- "status": {"key": "status", "type": "str"},
- "tactics": {"key": "tactics", "type": "[str]"},
- "techniques": {"key": "techniques", "type": "[str]"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "kind": {"key": "kind", "type": "str"},
+ "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
+ "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
+ "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
+ "description": {"key": "properties.description", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "required_data_connectors": {
+ "key": "properties.requiredDataConnectors",
+ "type": "[AlertRuleTemplateDataSource]",
+ },
+ "status": {"key": "properties.status", "type": "str"},
+ "display_names_filter": {"key": "properties.displayNamesFilter", "type": "[str]"},
+ "display_names_exclude_filter": {"key": "properties.displayNamesExcludeFilter", "type": "[str]"},
+ "product_filter": {"key": "properties.productFilter", "type": "str"},
+ "severities_filter": {"key": "properties.severitiesFilter", "type": "[str]"},
}
def __init__(
self,
*,
- query: Optional[str] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- version: Optional[str] = None,
- custom_details: Optional[Dict[str, str]] = None,
- entity_mappings: Optional[List["_models.EntityMapping"]] = None,
- alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- event_grouping_settings: Optional["_models.EventGroupingSettings"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
alert_rules_created_by_template_count: Optional[int] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- **kwargs
- ):
+ display_names_filter: Optional[List[str]] = None,
+ display_names_exclude_filter: Optional[List[str]] = None,
+ product_filter: Optional[Union[str, "_models.MicrosoftSecurityProductName"]] = None,
+ severities_filter: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword query: The query that creates alerts for this rule.
- :paramtype query: str
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword version: The version of this template - in format , where all are numbers. For
- example <1.0.2>.
- :paramtype version: str
- :keyword custom_details: Dictionary of string key-value pairs of columns to be attached to the
- alert.
- :paramtype custom_details: dict[str, str]
- :keyword entity_mappings: Array of the entity mappings of the alert rule.
- :paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
- :keyword alert_details_override: The alert details override settings.
- :paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword event_grouping_settings: The event grouping settings.
- :paramtype event_grouping_settings: ~azure.mgmt.securityinsight.models.EventGroupingSettings
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
:paramtype alert_rules_created_by_template_count: int
@@ -16219,177 +9234,404 @@ def __init__(
:paramtype description: str
:keyword display_name: The display name for alert rule template.
:paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
+ :keyword required_data_connectors: The required data connectors for this template.
:paramtype required_data_connectors:
list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
:keyword status: The alert rule template status. Known values are: "Installed", "Available",
and "NotAvailable".
:paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
+ :keyword display_names_filter: the alerts' displayNames on which the cases will be generated.
+ :paramtype display_names_filter: list[str]
+ :keyword display_names_exclude_filter: the alerts' displayNames on which the cases will not be
+ generated.
+ :paramtype display_names_exclude_filter: list[str]
+ :keyword product_filter: The alerts' productName on which the cases will be generated. Known
+ values are: "Microsoft Cloud App Security", "Azure Security Center", "Azure Advanced Threat
+ Protection", "Azure Active Directory Identity Protection", and "Azure Security Center for IoT".
+ :paramtype product_filter: str or
+ ~azure.mgmt.securityinsight.models.MicrosoftSecurityProductName
+ :keyword severities_filter: the alerts' severities on which the cases will be generated.
+ :paramtype severities_filter: list[str or ~azure.mgmt.securityinsight.models.AlertSeverity]
"""
- super().__init__(
- alert_rules_created_by_template_count=alert_rules_created_by_template_count,
- description=description,
- display_name=display_name,
- required_data_connectors=required_data_connectors,
- status=status,
- tactics=tactics,
- techniques=techniques,
- query=query,
- severity=severity,
- version=version,
- custom_details=custom_details,
- entity_mappings=entity_mappings,
- alert_details_override=alert_details_override,
- event_grouping_settings=event_grouping_settings,
- sentinel_entities_mappings=sentinel_entities_mappings,
- **kwargs
- )
- self.query = query
- self.severity = severity
- self.version = version
- self.custom_details = custom_details
- self.entity_mappings = entity_mappings
- self.alert_details_override = alert_details_override
- self.event_grouping_settings = event_grouping_settings
- self.sentinel_entities_mappings = sentinel_entities_mappings
+ super().__init__(**kwargs)
+ self.kind: str = "MicrosoftSecurityIncidentCreation"
self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.last_updated_date_utc = None
self.created_date_utc = None
+ self.last_updated_date_utc = None
self.description = description
self.display_name = display_name
self.required_data_connectors = required_data_connectors
self.status = status
- self.tactics = tactics
- self.techniques = techniques
+ self.display_names_filter = display_names_filter
+ self.display_names_exclude_filter = display_names_exclude_filter
+ self.product_filter = product_filter
+ self.severities_filter = severities_filter
-class Office365ProjectCheckRequirements(DataConnectorsCheckRequirements):
- """Represents Office365 Project requirements check request.
+class MSTIDataConnector(DataConnector):
+ """Represents Microsoft 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.
+ All required parameters must be populated in order to send to server.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
+ :ivar data_types: The available data types for the connector.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
"""
_validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
"kind": {"required": True},
}
_attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "MSTIDataConnectorDataTypes"},
+ }
+
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.MSTIDataConnectorDataTypes"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = "MicrosoftThreatIntelligence"
+ self.tenant_id = tenant_id
+ self.data_types = data_types
+
+
+class MSTIDataConnectorDataTypes(_serialization.Model):
+ """The available data types for Microsoft Threat Intelligence data connector.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar microsoft_emerging_threat_feed: Data type for Microsoft Threat Intelligence data
+ connector. Required.
+ :vartype microsoft_emerging_threat_feed:
+ ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed
+ """
+
+ _validation = {
+ "microsoft_emerging_threat_feed": {"required": True},
+ }
+
+ _attribute_map = {
+ "microsoft_emerging_threat_feed": {
+ "key": "microsoftEmergingThreatFeed",
+ "type": "MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
+ },
+ }
+
+ def __init__(
+ self,
+ *,
+ microsoft_emerging_threat_feed: "_models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword microsoft_emerging_threat_feed: Data type for Microsoft Threat Intelligence data
+ connector. Required.
+ :paramtype microsoft_emerging_threat_feed:
+ ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed
+ """
+ super().__init__(**kwargs)
+ self.microsoft_emerging_threat_feed = microsoft_emerging_threat_feed
+
+
+class MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed(
+ DataConnectorDataTypeCommon
+): # pylint: disable=name-too-long
+ """Data type for Microsoft Threat Intelligence data connector.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :ivar lookback_period: The lookback period for the feed to be imported. The date-time to begin
+ importing the feed from, for example: 2024-01-01T00:00:00.000Z. Required.
+ :vartype lookback_period: ~datetime.datetime
+ """
+
+ _validation = {
+ "lookback_period": {"required": True},
+ }
+
+ _attribute_map = {
+ "state": {"key": "state", "type": "str"},
+ "lookback_period": {"key": "lookbackPeriod", "type": "iso-8601"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ lookback_period: datetime.datetime,
+ state: Optional[Union[str, "_models.DataTypeState"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
+ :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :keyword lookback_period: The lookback period for the feed to be imported. The date-time to
+ begin importing the feed from, for example: 2024-01-01T00:00:00.000Z. Required.
+ :paramtype lookback_period: ~datetime.datetime
"""
- super().__init__(**kwargs)
- self.kind: str = "Office365Project"
- self.tenant_id = tenant_id
+ super().__init__(state=state, **kwargs)
+ self.lookback_period = lookback_period
-class Office365ProjectCheckRequirementsProperties(DataConnectorTenantId):
- """Office365 Project requirements check properties.
+class MSTIDataConnectorProperties(DataConnectorTenantId):
+ """Microsoft Threat Intelligence data connector properties.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
+ :ivar data_types: The available data types for the connector. Required.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
"""
_validation = {
- "tenant_id": {"required": True},
+ "data_types": {"required": True},
}
_attribute_map = {
"tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "MSTIDataConnectorDataTypes"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self, *, data_types: "_models.MSTIDataConnectorDataTypes", tenant_id: Optional[str] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
+ :keyword data_types: The available data types for the connector. Required.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
"""
super().__init__(tenant_id=tenant_id, **kwargs)
+ self.data_types = data_types
-class Office365ProjectConnectorDataTypes(_serialization.Model):
- """The available data types for Office Microsoft Project data connector.
+class NoneAuthModel(CcpAuthConfig):
+ """Model for API authentication with no authentication method - public API.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar logs: Logs data type. Required.
- :vartype logs: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypesLogs
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
"""
_validation = {
- "logs": {"required": True},
+ "type": {"required": True},
}
_attribute_map = {
- "logs": {"key": "logs", "type": "Office365ProjectConnectorDataTypesLogs"},
+ "type": {"key": "type", "type": "str"},
}
- def __init__(self, *, logs: "_models.Office365ProjectConnectorDataTypesLogs", **kwargs):
- """
- :keyword logs: Logs data type. Required.
- :paramtype logs: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypesLogs
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.logs = logs
+ self.type: str = "None"
-class Office365ProjectConnectorDataTypesLogs(DataConnectorDataTypeCommon):
- """Logs data type.
+class OAuthModel(CcpAuthConfig):
+ """Model for API authentication with OAuth2.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar authorization_code: The user's authorization code.
+ :vartype authorization_code: str
+ :ivar client_secret: The Application (client) secret that the OAuth provider assigned to your
+ app. Required.
+ :vartype client_secret: str
+ :ivar client_id: The Application (client) ID that the OAuth provider assigned to your app.
+ Required.
+ :vartype client_id: str
+ :ivar is_credentials_in_headers: Indicating whether we want to send the clientId and
+ clientSecret to token endpoint in the headers.
+ :vartype is_credentials_in_headers: bool
+ :ivar scope: The Application (client) Scope that the OAuth provider assigned to your app.
+ :vartype scope: str
+ :ivar redirect_uri: The Application redirect url that the user config in the OAuth provider.
+ :vartype redirect_uri: str
+ :ivar grant_type: The grant type, usually will be 'authorization code'. Required.
+ :vartype grant_type: str
+ :ivar token_endpoint: The token endpoint. Defines the OAuth2 refresh token. Required.
+ :vartype token_endpoint: str
+ :ivar token_endpoint_headers: The token endpoint headers.
+ :vartype token_endpoint_headers: dict[str, str]
+ :ivar token_endpoint_query_parameters: The token endpoint query parameters.
+ :vartype token_endpoint_query_parameters: dict[str, str]
+ :ivar authorization_endpoint: The authorization endpoint.
+ :vartype authorization_endpoint: str
+ :ivar authorization_endpoint_headers: The authorization endpoint headers.
+ :vartype authorization_endpoint_headers: dict[str, str]
+ :ivar authorization_endpoint_query_parameters: The authorization endpoint query parameters.
+ :vartype authorization_endpoint_query_parameters: dict[str, str]
+ :ivar is_jwt_bearer_flow: A value indicating whether it's a JWT flow.
+ :vartype is_jwt_bearer_flow: bool
+ :ivar access_token_prepend: Access token prepend. Default is 'Bearer'.
+ :vartype access_token_prepend: str
"""
_validation = {
- "state": {"required": True},
+ "type": {"required": True},
+ "client_secret": {"required": True},
+ "client_id": {"required": True},
+ "grant_type": {"required": True},
+ "token_endpoint": {"required": True},
}
_attribute_map = {
- "state": {"key": "state", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "authorization_code": {"key": "authorizationCode", "type": "str"},
+ "client_secret": {"key": "clientSecret", "type": "str"},
+ "client_id": {"key": "clientId", "type": "str"},
+ "is_credentials_in_headers": {"key": "isCredentialsInHeaders", "type": "bool"},
+ "scope": {"key": "scope", "type": "str"},
+ "redirect_uri": {"key": "redirectUri", "type": "str"},
+ "grant_type": {"key": "grantType", "type": "str"},
+ "token_endpoint": {"key": "tokenEndpoint", "type": "str"},
+ "token_endpoint_headers": {"key": "tokenEndpointHeaders", "type": "{str}"},
+ "token_endpoint_query_parameters": {"key": "tokenEndpointQueryParameters", "type": "{str}"},
+ "authorization_endpoint": {"key": "authorizationEndpoint", "type": "str"},
+ "authorization_endpoint_headers": {"key": "authorizationEndpointHeaders", "type": "{str}"},
+ "authorization_endpoint_query_parameters": {"key": "authorizationEndpointQueryParameters", "type": "{str}"},
+ "is_jwt_bearer_flow": {"key": "isJwtBearerFlow", "type": "bool"},
+ "access_token_prepend": {"key": "accessTokenPrepend", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ def __init__(
+ self,
+ *,
+ client_secret: str,
+ client_id: str,
+ grant_type: str,
+ token_endpoint: str,
+ authorization_code: Optional[str] = None,
+ is_credentials_in_headers: bool = False,
+ scope: Optional[str] = None,
+ redirect_uri: Optional[str] = None,
+ token_endpoint_headers: Optional[Dict[str, str]] = None,
+ token_endpoint_query_parameters: Optional[Dict[str, str]] = None,
+ authorization_endpoint: Optional[str] = None,
+ authorization_endpoint_headers: Optional[Dict[str, str]] = None,
+ authorization_endpoint_query_parameters: Optional[Dict[str, str]] = None,
+ is_jwt_bearer_flow: Optional[bool] = None,
+ access_token_prepend: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword authorization_code: The user's authorization code.
+ :paramtype authorization_code: str
+ :keyword client_secret: The Application (client) secret that the OAuth provider assigned to
+ your app. Required.
+ :paramtype client_secret: str
+ :keyword client_id: The Application (client) ID that the OAuth provider assigned to your app.
+ Required.
+ :paramtype client_id: str
+ :keyword is_credentials_in_headers: Indicating whether we want to send the clientId and
+ clientSecret to token endpoint in the headers.
+ :paramtype is_credentials_in_headers: bool
+ :keyword scope: The Application (client) Scope that the OAuth provider assigned to your app.
+ :paramtype scope: str
+ :keyword redirect_uri: The Application redirect url that the user config in the OAuth provider.
+ :paramtype redirect_uri: str
+ :keyword grant_type: The grant type, usually will be 'authorization code'. Required.
+ :paramtype grant_type: str
+ :keyword token_endpoint: The token endpoint. Defines the OAuth2 refresh token. Required.
+ :paramtype token_endpoint: str
+ :keyword token_endpoint_headers: The token endpoint headers.
+ :paramtype token_endpoint_headers: dict[str, str]
+ :keyword token_endpoint_query_parameters: The token endpoint query parameters.
+ :paramtype token_endpoint_query_parameters: dict[str, str]
+ :keyword authorization_endpoint: The authorization endpoint.
+ :paramtype authorization_endpoint: str
+ :keyword authorization_endpoint_headers: The authorization endpoint headers.
+ :paramtype authorization_endpoint_headers: dict[str, str]
+ :keyword authorization_endpoint_query_parameters: The authorization endpoint query parameters.
+ :paramtype authorization_endpoint_query_parameters: dict[str, str]
+ :keyword is_jwt_bearer_flow: A value indicating whether it's a JWT flow.
+ :paramtype is_jwt_bearer_flow: bool
+ :keyword access_token_prepend: Access token prepend. Default is 'Bearer'.
+ :paramtype access_token_prepend: str
"""
- super().__init__(state=state, **kwargs)
+ super().__init__(**kwargs)
+ self.type: str = "OAuth2"
+ self.authorization_code = authorization_code
+ self.client_secret = client_secret
+ self.client_id = client_id
+ self.is_credentials_in_headers = is_credentials_in_headers
+ self.scope = scope
+ self.redirect_uri = redirect_uri
+ self.grant_type = grant_type
+ self.token_endpoint = token_endpoint
+ self.token_endpoint_headers = token_endpoint_headers
+ self.token_endpoint_query_parameters = token_endpoint_query_parameters
+ self.authorization_endpoint = authorization_endpoint
+ self.authorization_endpoint_headers = authorization_endpoint_headers
+ self.authorization_endpoint_query_parameters = authorization_endpoint_query_parameters
+ self.is_jwt_bearer_flow = is_jwt_bearer_flow
+ self.access_token_prepend = access_token_prepend
-class Office365ProjectDataConnector(DataConnector):
- """Represents Office Microsoft Project data connector.
+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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -16403,161 +9645,533 @@ class Office365ProjectDataConnector(DataConnector):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
:ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypes
+ :vartype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "OfficeDataConnectorDataTypes"},
+ }
+
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.OfficeDataConnectorDataTypes"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = "Office365"
+ self.tenant_id = tenant_id
+ self.data_types = data_types
+
+
+class OfficeDataConnectorDataTypes(_serialization.Model):
+ """The available data types for office data connector.
+
+ :ivar exchange: Exchange data type connection.
+ :vartype exchange: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange
+ :ivar share_point: SharePoint data type connection.
+ :vartype share_point: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint
+ :ivar teams: Teams data type connection.
+ :vartype teams: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesTeams
+ """
+
+ _attribute_map = {
+ "exchange": {"key": "exchange", "type": "OfficeDataConnectorDataTypesExchange"},
+ "share_point": {"key": "sharePoint", "type": "OfficeDataConnectorDataTypesSharePoint"},
+ "teams": {"key": "teams", "type": "OfficeDataConnectorDataTypesTeams"},
+ }
+
+ def __init__(
+ self,
+ *,
+ exchange: Optional["_models.OfficeDataConnectorDataTypesExchange"] = None,
+ share_point: Optional["_models.OfficeDataConnectorDataTypesSharePoint"] = None,
+ teams: Optional["_models.OfficeDataConnectorDataTypesTeams"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword exchange: Exchange data type connection.
+ :paramtype exchange: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange
+ :keyword share_point: SharePoint data type connection.
+ :paramtype share_point:
+ ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint
+ :keyword teams: Teams data type connection.
+ :paramtype teams: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesTeams
+ """
+ super().__init__(**kwargs)
+ self.exchange = exchange
+ self.share_point = share_point
+ self.teams = teams
+
+
+class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon):
+ """Exchange data type connection.
+
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
+
+
+class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon):
+ """SharePoint data type connection.
+
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
+
+
+class OfficeDataConnectorDataTypesTeams(DataConnectorDataTypeCommon):
+ """Teams data type connection.
+
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
+
+
+class Operation(_serialization.Model):
+ """Operation provided by provider.
+
+ :ivar display: Properties of the operation.
+ :vartype display: ~azure.mgmt.securityinsight.models.OperationDisplay
+ :ivar name: Name of the operation.
+ :vartype name: str
+ :ivar origin: The origin of the operation.
+ :vartype origin: str
+ :ivar is_data_action: Indicates whether the operation is a data action.
+ :vartype is_data_action: bool
+ """
+
+ _attribute_map = {
+ "display": {"key": "display", "type": "OperationDisplay"},
+ "name": {"key": "name", "type": "str"},
+ "origin": {"key": "origin", "type": "str"},
+ "is_data_action": {"key": "isDataAction", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ display: Optional["_models.OperationDisplay"] = None,
+ name: Optional[str] = None,
+ origin: Optional[str] = None,
+ is_data_action: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword display: Properties of the operation.
+ :paramtype display: ~azure.mgmt.securityinsight.models.OperationDisplay
+ :keyword name: Name of the operation.
+ :paramtype name: str
+ :keyword origin: The origin of the operation.
+ :paramtype origin: str
+ :keyword is_data_action: Indicates whether the operation is a data action.
+ :paramtype is_data_action: bool
+ """
+ super().__init__(**kwargs)
+ self.display = display
+ self.name = name
+ self.origin = origin
+ self.is_data_action = is_data_action
+
+
+class OperationDisplay(_serialization.Model):
+ """Properties of the operation.
+
+ :ivar description: Description of the operation.
+ :vartype description: str
+ :ivar operation: Operation name.
+ :vartype operation: str
+ :ivar provider: Provider name.
+ :vartype provider: str
+ :ivar resource: Resource name.
+ :vartype resource: str
+ """
+
+ _attribute_map = {
+ "description": {"key": "description", "type": "str"},
+ "operation": {"key": "operation", "type": "str"},
+ "provider": {"key": "provider", "type": "str"},
+ "resource": {"key": "resource", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ description: Optional[str] = None,
+ operation: Optional[str] = None,
+ provider: Optional[str] = None,
+ resource: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword description: Description of the operation.
+ :paramtype description: str
+ :keyword operation: Operation name.
+ :paramtype operation: str
+ :keyword provider: Provider name.
+ :paramtype provider: str
+ :keyword resource: Resource name.
+ :paramtype resource: str
+ """
+ super().__init__(**kwargs)
+ self.description = description
+ self.operation = operation
+ self.provider = provider
+ self.resource = resource
+
+
+class OperationsList(_serialization.Model):
+ """Lists the operations available in the SecurityInsights RP.
+
+ 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 server.
+
+ :ivar next_link: URL to fetch the next set of operations.
+ :vartype next_link: str
+ :ivar value: Array of operations. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Operation]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "Office365ProjectConnectorDataTypes"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Operation]"},
}
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.Office365ProjectConnectorDataTypes"] = None,
- **kwargs
- ):
+ def __init__(self, *, value: List["_models.Operation"], **kwargs: Any) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypes
+ :keyword value: Array of operations. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Operation]
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Office365Project"
- self.tenant_id = tenant_id
- self.data_types = data_types
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class Office365ProjectDataConnectorProperties(DataConnectorTenantId):
- """Office Microsoft Project data connector properties.
+class OracleAuthModel(CcpAuthConfig):
+ """Model for API authentication for Oracle.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar tenant_id: Oracle tenant ID. Required.
:vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypes
+ :ivar user_id: Oracle user ID. Required.
+ :vartype user_id: str
+ :ivar public_fingerprint: Public Fingerprint. Required.
+ :vartype public_fingerprint: str
+ :ivar pem_file: Content of the PRM file. Required.
+ :vartype pem_file: str
"""
_validation = {
+ "type": {"required": True},
"tenant_id": {"required": True},
- "data_types": {"required": True},
+ "user_id": {"required": True},
+ "public_fingerprint": {"required": True},
+ "pem_file": {"required": True},
}
_attribute_map = {
+ "type": {"key": "type", "type": "str"},
"tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "Office365ProjectConnectorDataTypes"},
+ "user_id": {"key": "userId", "type": "str"},
+ "public_fingerprint": {"key": "publicFingerprint", "type": "str"},
+ "pem_file": {"key": "pemFile", "type": "str"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.Office365ProjectConnectorDataTypes", **kwargs):
+ def __init__(self, *, tenant_id: str, user_id: str, public_fingerprint: str, pem_file: str, **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
+ :keyword tenant_id: Oracle tenant ID. Required.
:paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypes
+ :keyword user_id: Oracle user ID. Required.
+ :paramtype user_id: str
+ :keyword public_fingerprint: Public Fingerprint. Required.
+ :paramtype public_fingerprint: str
+ :keyword pem_file: Content of the PRM file. Required.
+ :paramtype pem_file: str
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.type: str = "Oracle"
+ self.tenant_id = tenant_id
+ self.user_id = user_id
+ self.public_fingerprint = public_fingerprint
+ self.pem_file = pem_file
-class OfficeATPCheckRequirements(DataConnectorsCheckRequirements):
- """Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request.
- All required parameters must be populated in order to send to Azure.
+class PackageBaseProperties(_serialization.Model):
+ """Describes package properties.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
+ :ivar content_id: The content id of the package.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :vartype content_product_id: str
+ :ivar content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar content_schema_version: The version of the content schema.
+ :vartype content_schema_version: str
+ :ivar is_new: Flag indicates if this is a newly published package. Known values are: "true" and
+ "false".
+ :vartype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :vartype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_featured: Flag indicates if this package is among the featured list. Known values are:
+ "true" and "false".
+ :vartype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar version: the latest version number of the package.
+ :vartype version: str
+ :ivar display_name: The display name of the package.
+ :vartype display_name: str
+ :ivar description: The description of the package.
+ :vartype description: str
+ :ivar publisher_display_name: The publisher display name of the package.
+ :vartype publisher_display_name: str
+ :ivar source: The source of the package.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The author of the package.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: The support tier of the package.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: The support tier of the package.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar providers: Providers for the package item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date package item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the package item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar categories: The categories of the package.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
"""
- _validation = {
- "kind": {"required": True},
- }
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "content_id": {"key": "contentId", "type": "str"},
+ "content_product_id": {"key": "contentProductId", "type": "str"},
+ "content_kind": {"key": "contentKind", "type": "str"},
+ "content_schema_version": {"key": "contentSchemaVersion", "type": "str"},
+ "is_new": {"key": "isNew", "type": "str"},
+ "is_preview": {"key": "isPreview", "type": "str"},
+ "is_featured": {"key": "isFeatured", "type": "str"},
+ "is_deprecated": {"key": "isDeprecated", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "publisher_display_name": {"key": "publisherDisplayName", "type": "str"},
+ "source": {"key": "source", "type": "MetadataSource"},
+ "author": {"key": "author", "type": "MetadataAuthor"},
+ "support": {"key": "support", "type": "MetadataSupport"},
+ "dependencies": {"key": "dependencies", "type": "MetadataDependencies"},
+ "providers": {"key": "providers", "type": "[str]"},
+ "first_publish_date": {"key": "firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "lastPublishDate", "type": "date"},
+ "categories": {"key": "categories", "type": "MetadataCategories"},
+ "threat_analysis_tactics": {"key": "threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "threatAnalysisTechniques", "type": "[str]"},
+ "icon": {"key": "icon", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ content_schema_version: Optional[str] = None,
+ is_new: Optional[Union[str, "_models.Flag"]] = None,
+ is_preview: Optional[Union[str, "_models.Flag"]] = None,
+ is_featured: Optional[Union[str, "_models.Flag"]] = None,
+ is_deprecated: Optional[Union[str, "_models.Flag"]] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ description: Optional[str] = None,
+ publisher_display_name: Optional[str] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ icon: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword content_id: The content id of the package.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :paramtype content_product_id: str
+ :keyword content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword content_schema_version: The version of the content schema.
+ :paramtype content_schema_version: str
+ :keyword is_new: Flag indicates if this is a newly published package. Known values are: "true"
+ and "false".
+ :paramtype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :paramtype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_featured: Flag indicates if this package is among the featured list. Known values
+ are: "true" and "false".
+ :paramtype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :paramtype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword version: the latest version number of the package.
+ :paramtype version: str
+ :keyword display_name: The display name of the package.
+ :paramtype display_name: str
+ :keyword description: The description of the package.
+ :paramtype description: str
+ :keyword publisher_display_name: The publisher display name of the package.
+ :paramtype publisher_display_name: str
+ :keyword source: The source of the package.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The author of the package.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: The support tier of the package.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: The support tier of the package.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword providers: Providers for the package item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date package item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the package item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword categories: The categories of the package.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
"""
super().__init__(**kwargs)
- self.kind: str = "OfficeATP"
- self.tenant_id = tenant_id
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.content_kind = content_kind
+ self.content_schema_version = content_schema_version
+ self.is_new = is_new
+ self.is_preview = is_preview
+ self.is_featured = is_featured
+ self.is_deprecated = is_deprecated
+ self.version = version
+ self.display_name = display_name
+ self.description = description
+ self.publisher_display_name = publisher_display_name
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.categories = categories
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.icon = icon
+
+class PackageList(_serialization.Model):
+ """List available packages.
-class OfficeATPCheckRequirementsProperties(DataConnectorTenantId):
- """OfficeATP (Office 365 Advanced Threat Protection) requirements check properties.
+ 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.
+ All required parameters must be populated in order to send to server.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
+ :ivar next_link: URL to fetch the next set of packages.
+ :vartype next_link: str
+ :ivar value: Array of packages. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.PackageModel]
"""
_validation = {
- "tenant_id": {"required": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[PackageModel]"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(self, *, value: List["_models.PackageModel"], **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword value: Array of packages. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.PackageModel]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class OfficeATPDataConnector(DataConnector):
- """Represents OfficeATP (Office 365 Advanced Threat Protection) data connector.
+class PackageModel(ResourceWithEtag):
+ """Represents a Package in Azure Security Insights.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -16569,18 +10183,58 @@ class OfficeATPDataConnector(DataConnector):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :ivar content_id: The content id of the package.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :vartype content_product_id: str
+ :ivar content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar content_schema_version: The version of the content schema.
+ :vartype content_schema_version: str
+ :ivar is_new: Flag indicates if this is a newly published package. Known values are: "true" and
+ "false".
+ :vartype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :vartype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_featured: Flag indicates if this package is among the featured list. Known values are:
+ "true" and "false".
+ :vartype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar version: the latest version number of the package.
+ :vartype version: str
+ :ivar display_name: The display name of the package.
+ :vartype display_name: str
+ :ivar description: The description of the package.
+ :vartype description: str
+ :ivar publisher_display_name: The publisher display name of the package.
+ :vartype publisher_display_name: str
+ :ivar source: The source of the package.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The author of the package.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: The support tier of the package.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: The support tier of the package.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar providers: Providers for the package item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date package item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the package item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar categories: The categories of the package.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
"""
_validation = {
@@ -16588,7 +10242,6 @@ class OfficeATPDataConnector(DataConnector):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
}
_attribute_map = {
@@ -16597,159 +10250,336 @@ class OfficeATPDataConnector(DataConnector):
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
+ "content_id": {"key": "properties.contentId", "type": "str"},
+ "content_product_id": {"key": "properties.contentProductId", "type": "str"},
+ "content_kind": {"key": "properties.contentKind", "type": "str"},
+ "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
+ "is_new": {"key": "properties.isNew", "type": "str"},
+ "is_preview": {"key": "properties.isPreview", "type": "str"},
+ "is_featured": {"key": "properties.isFeatured", "type": "str"},
+ "is_deprecated": {"key": "properties.isDeprecated", "type": "str"},
+ "version": {"key": "properties.version", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "publisher_display_name": {"key": "properties.publisherDisplayName", "type": "str"},
+ "source": {"key": "properties.source", "type": "MetadataSource"},
+ "author": {"key": "properties.author", "type": "MetadataAuthor"},
+ "support": {"key": "properties.support", "type": "MetadataSupport"},
+ "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
+ "providers": {"key": "properties.providers", "type": "[str]"},
+ "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
+ "categories": {"key": "properties.categories", "type": "MetadataCategories"},
+ "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
+ "icon": {"key": "properties.icon", "type": "str"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- **kwargs
- ):
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ content_schema_version: Optional[str] = None,
+ is_new: Optional[Union[str, "_models.Flag"]] = None,
+ is_preview: Optional[Union[str, "_models.Flag"]] = None,
+ is_featured: Optional[Union[str, "_models.Flag"]] = None,
+ is_deprecated: Optional[Union[str, "_models.Flag"]] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ description: Optional[str] = None,
+ publisher_display_name: Optional[str] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ icon: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :keyword content_id: The content id of the package.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :paramtype content_product_id: str
+ :keyword content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword content_schema_version: The version of the content schema.
+ :paramtype content_schema_version: str
+ :keyword is_new: Flag indicates if this is a newly published package. Known values are: "true"
+ and "false".
+ :paramtype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :paramtype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_featured: Flag indicates if this package is among the featured list. Known values
+ are: "true" and "false".
+ :paramtype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :paramtype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword version: the latest version number of the package.
+ :paramtype version: str
+ :keyword display_name: The display name of the package.
+ :paramtype display_name: str
+ :keyword description: The description of the package.
+ :paramtype description: str
+ :keyword publisher_display_name: The publisher display name of the package.
+ :paramtype publisher_display_name: str
+ :keyword source: The source of the package.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The author of the package.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: The support tier of the package.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: The support tier of the package.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword providers: Providers for the package item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date package item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the package item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword categories: The categories of the package.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "OfficeATP"
- self.tenant_id = tenant_id
- self.data_types = data_types
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.content_kind = content_kind
+ self.content_schema_version = content_schema_version
+ self.is_new = is_new
+ self.is_preview = is_preview
+ self.is_featured = is_featured
+ self.is_deprecated = is_deprecated
+ self.version = version
+ self.display_name = display_name
+ self.description = description
+ self.publisher_display_name = publisher_display_name
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.categories = categories
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.icon = icon
+
+
+class PackageProperties(PackageBaseProperties):
+ """Describes package properties.
+
+ :ivar content_id: The content id of the package.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :vartype content_product_id: str
+ :ivar content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar content_schema_version: The version of the content schema.
+ :vartype content_schema_version: str
+ :ivar is_new: Flag indicates if this is a newly published package. Known values are: "true" and
+ "false".
+ :vartype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :vartype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_featured: Flag indicates if this package is among the featured list. Known values are:
+ "true" and "false".
+ :vartype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar version: the latest version number of the package.
+ :vartype version: str
+ :ivar display_name: The display name of the package.
+ :vartype display_name: str
+ :ivar description: The description of the package.
+ :vartype description: str
+ :ivar publisher_display_name: The publisher display name of the package.
+ :vartype publisher_display_name: str
+ :ivar source: The source of the package.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The author of the package.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: The support tier of the package.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: The support tier of the package.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar providers: Providers for the package item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date package item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the package item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar categories: The categories of the package.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ """
-class OfficeATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """OfficeATP (Office 365 Advanced Threat Protection) data connector properties.
+class PlaybookActionProperties(_serialization.Model):
+ """PlaybookActionProperties.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :ivar logic_app_resource_id: The resource id of the playbook resource. Required.
+ :vartype logic_app_resource_id: str
+ :ivar tenant_id: The tenant id of the playbook resource.
:vartype tenant_id: str
"""
_validation = {
- "tenant_id": {"required": True},
+ "logic_app_resource_id": {"required": True},
}
_attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
+ "logic_app_resource_id": {"key": "logicAppResourceId", "type": "str"},
"tenant_id": {"key": "tenantId", "type": "str"},
}
- def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
+ def __init__(self, *, logic_app_resource_id: str, tenant_id: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
+ :keyword logic_app_resource_id: The resource id of the playbook resource. Required.
+ :paramtype logic_app_resource_id: str
+ :keyword tenant_id: The tenant id of the playbook resource.
:paramtype tenant_id: str
"""
- super().__init__(tenant_id=tenant_id, data_types=data_types, **kwargs)
- self.data_types = data_types
+ super().__init__(**kwargs)
+ self.logic_app_resource_id = logic_app_resource_id
self.tenant_id = tenant_id
-class OfficeConsent(Resource):
- """Consent for Office365 tenant that already made.
+class PremiumMdtiDataConnectorDataTypes(_serialization.Model):
+ """The available data types for Premium Microsoft Defender for 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 server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar tenant_id: The tenantId of the Office365 with the consent.
- :vartype tenant_id: str
- :ivar consent_id: Help to easily cascade among the data layers.
- :vartype consent_id: str
+ :ivar connector: Data type for Premium Microsoft Defender for Threat Intelligence data
+ connector. Required.
+ :vartype connector:
+ ~azure.mgmt.securityinsight.models.PremiumMdtiDataConnectorDataTypesConnector
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ "connector": {"required": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "consent_id": {"key": "properties.consentId", "type": "str"},
+ "connector": {"key": "connector", "type": "PremiumMdtiDataConnectorDataTypesConnector"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, consent_id: Optional[str] = None, **kwargs):
+ def __init__(self, *, connector: "_models.PremiumMdtiDataConnectorDataTypesConnector", **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenantId of the Office365 with the consent.
- :paramtype tenant_id: str
- :keyword consent_id: Help to easily cascade among the data layers.
- :paramtype consent_id: str
+ :keyword connector: Data type for Premium Microsoft Defender for Threat Intelligence data
+ connector. Required.
+ :paramtype connector:
+ ~azure.mgmt.securityinsight.models.PremiumMdtiDataConnectorDataTypesConnector
"""
super().__init__(**kwargs)
- self.tenant_id = tenant_id
- self.consent_id = consent_id
+ self.connector = connector
-class OfficeConsentList(_serialization.Model):
- """List of all the office365 consents.
+class PremiumMdtiDataConnectorDataTypesConnector(DataConnectorDataTypeCommon): # pylint: disable=name-too-long
+ """Data type for Premium Microsoft Defender for Threat Intelligence data connector.
- Variables are only populated by the server, and will be ignored when sending a request.
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
- All required parameters must be populated in order to send to Azure.
- :ivar next_link: URL to fetch the next set of office consents.
- :vartype next_link: str
- :ivar value: Array of the consents. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.OfficeConsent]
+class PremiumMdtiDataConnectorProperties(DataConnectorTenantId):
+ """Premium Microsoft Defender for Threat Intelligence data connector properties.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar tenant_id: The tenant id to connect to, and get the data from.
+ :vartype tenant_id: str
+ :ivar lookback_period: The lookback period for the feed to be imported. The date-time to begin
+ importing the feed from, for example: 2024-01-01T00:00:00.000Z. Required.
+ :vartype lookback_period: ~datetime.datetime
+ :ivar required_skus_present: The flag to indicate whether the tenant has the premium SKU
+ required to access this connector.
+ :vartype required_skus_present: bool
+ :ivar data_types: The available data types for the connector. Required.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.PremiumMdtiDataConnectorDataTypes
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ "lookback_period": {"required": True},
+ "data_types": {"required": True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[OfficeConsent]"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "lookback_period": {"key": "lookbackPeriod", "type": "iso-8601"},
+ "required_skus_present": {"key": "requiredSKUsPresent", "type": "bool"},
+ "data_types": {"key": "dataTypes", "type": "PremiumMdtiDataConnectorDataTypes"},
}
- def __init__(self, *, value: List["_models.OfficeConsent"], **kwargs):
+ def __init__(
+ self,
+ *,
+ lookback_period: datetime.datetime,
+ data_types: "_models.PremiumMdtiDataConnectorDataTypes",
+ tenant_id: Optional[str] = None,
+ required_skus_present: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of the consents. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.OfficeConsent]
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
+ :keyword lookback_period: The lookback period for the feed to be imported. The date-time to
+ begin importing the feed from, for example: 2024-01-01T00:00:00.000Z. Required.
+ :paramtype lookback_period: ~datetime.datetime
+ :keyword required_skus_present: The flag to indicate whether the tenant has the premium SKU
+ required to access this connector.
+ :paramtype required_skus_present: bool
+ :keyword data_types: The available data types for the connector. Required.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.PremiumMdtiDataConnectorDataTypes
"""
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ super().__init__(tenant_id=tenant_id, **kwargs)
+ self.lookback_period = lookback_period
+ self.required_skus_present = required_skus_present
+ self.data_types = data_types
-class OfficeDataConnector(DataConnector):
- """Represents office data connector.
+class PremiumMicrosoftDefenderForThreatIntelligence(DataConnector): # pylint: disable=name-too-long
+ """Represents Premium Microsoft Defender for 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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -16763,16 +10593,20 @@ class OfficeDataConnector(DataConnector):
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
+ :ivar lookback_period: The lookback period for the feed to be imported. The date-time to begin
+ importing the feed from, for example: 2024-01-01T00:00:00.000Z.
+ :vartype lookback_period: ~datetime.datetime
+ :ivar required_skus_present: The flag to indicate whether the tenant has the premium SKU
+ required to access this connector.
+ :vartype required_skus_present: bool
:ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
+ :vartype data_types: ~azure.mgmt.securityinsight.models.PremiumMdtiDataConnectorDataTypes
"""
_validation = {
@@ -16791,7 +10625,9 @@ class OfficeDataConnector(DataConnector):
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "OfficeDataConnectorDataTypes"},
+ "lookback_period": {"key": "properties.lookbackPeriod", "type": "iso-8601"},
+ "required_skus_present": {"key": "properties.requiredSKUsPresent", "type": "bool"},
+ "data_types": {"key": "properties.dataTypes", "type": "PremiumMdtiDataConnectorDataTypes"},
}
def __init__(
@@ -16799,254 +10635,842 @@ def __init__(
*,
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
- data_types: Optional["_models.OfficeDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ lookback_period: Optional[datetime.datetime] = None,
+ required_skus_present: Optional[bool] = None,
+ data_types: Optional["_models.PremiumMdtiDataConnectorDataTypes"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
:keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
+ :keyword lookback_period: The lookback period for the feed to be imported. The date-time to
+ begin importing the feed from, for example: 2024-01-01T00:00:00.000Z.
+ :paramtype lookback_period: ~datetime.datetime
+ :keyword required_skus_present: The flag to indicate whether the tenant has the premium SKU
+ required to access this connector.
+ :paramtype required_skus_present: bool
:keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.PremiumMdtiDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Office365"
+ self.kind: str = "PremiumMicrosoftDefenderForThreatIntelligence"
self.tenant_id = tenant_id
+ self.lookback_period = lookback_period
+ self.required_skus_present = required_skus_present
self.data_types = data_types
-class OfficeDataConnectorDataTypes(_serialization.Model):
- """The available data types for office data connector.
+class ProcessEntity(Entity):
+ """Represents a process entity.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar exchange: Exchange data type connection. Required.
- :vartype exchange: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange
- :ivar share_point: SharePoint data type connection. Required.
- :vartype share_point: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint
- :ivar teams: Teams data type connection. Required.
- :vartype teams: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesTeams
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar account_entity_id: The account entity id running the processes.
+ :vartype account_entity_id: str
+ :ivar command_line: The command line used to create the process.
+ :vartype command_line: str
+ :ivar creation_time_utc: The time when the process started to run.
+ :vartype creation_time_utc: ~datetime.datetime
+ :ivar elevation_token: The elevation token associated with the process. Known values are:
+ "Default", "Full", and "Limited".
+ :vartype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
+ :ivar host_entity_id: The host entity id on which the process was running.
+ :vartype host_entity_id: str
+ :ivar host_logon_session_entity_id: The session entity id in which the process was running.
+ :vartype host_logon_session_entity_id: str
+ :ivar image_file_entity_id: Image file entity id.
+ :vartype image_file_entity_id: str
+ :ivar parent_process_entity_id: The parent process entity id.
+ :vartype parent_process_entity_id: str
+ :ivar process_id: The process ID.
+ :vartype process_id: str
"""
_validation = {
- "exchange": {"required": True},
- "share_point": {"required": True},
- "teams": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "account_entity_id": {"readonly": True},
+ "command_line": {"readonly": True},
+ "creation_time_utc": {"readonly": True},
+ "host_entity_id": {"readonly": True},
+ "host_logon_session_entity_id": {"readonly": True},
+ "image_file_entity_id": {"readonly": True},
+ "parent_process_entity_id": {"readonly": True},
+ "process_id": {"readonly": True},
}
_attribute_map = {
- "exchange": {"key": "exchange", "type": "OfficeDataConnectorDataTypesExchange"},
- "share_point": {"key": "sharePoint", "type": "OfficeDataConnectorDataTypesSharePoint"},
- "teams": {"key": "teams", "type": "OfficeDataConnectorDataTypesTeams"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "kind": {"key": "kind", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "account_entity_id": {"key": "properties.accountEntityId", "type": "str"},
+ "command_line": {"key": "properties.commandLine", "type": "str"},
+ "creation_time_utc": {"key": "properties.creationTimeUtc", "type": "iso-8601"},
+ "elevation_token": {"key": "properties.elevationToken", "type": "str"},
+ "host_entity_id": {"key": "properties.hostEntityId", "type": "str"},
+ "host_logon_session_entity_id": {"key": "properties.hostLogonSessionEntityId", "type": "str"},
+ "image_file_entity_id": {"key": "properties.imageFileEntityId", "type": "str"},
+ "parent_process_entity_id": {"key": "properties.parentProcessEntityId", "type": "str"},
+ "process_id": {"key": "properties.processId", "type": "str"},
}
def __init__(
- self,
- *,
- exchange: "_models.OfficeDataConnectorDataTypesExchange",
- share_point: "_models.OfficeDataConnectorDataTypesSharePoint",
- teams: "_models.OfficeDataConnectorDataTypesTeams",
- **kwargs
- ):
+ self, *, elevation_token: Optional[Union[str, "_models.ElevationToken"]] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword exchange: Exchange data type connection. Required.
- :paramtype exchange: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange
- :keyword share_point: SharePoint data type connection. Required.
- :paramtype share_point:
- ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint
- :keyword teams: Teams data type connection. Required.
- :paramtype teams: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesTeams
+ :keyword elevation_token: The elevation token associated with the process. Known values are:
+ "Default", "Full", and "Limited".
+ :paramtype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
"""
super().__init__(**kwargs)
- self.exchange = exchange
- self.share_point = share_point
- self.teams = teams
+ self.kind: str = "Process"
+ self.additional_data = None
+ self.friendly_name = None
+ self.account_entity_id = None
+ self.command_line = None
+ self.creation_time_utc = None
+ self.elevation_token = elevation_token
+ self.host_entity_id = None
+ self.host_logon_session_entity_id = None
+ self.image_file_entity_id = None
+ self.parent_process_entity_id = None
+ self.process_id = None
-class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon):
- """Exchange data type connection.
+class ProcessEntityProperties(EntityCommonProperties):
+ """Process entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar account_entity_id: The account entity id running the processes.
+ :vartype account_entity_id: str
+ :ivar command_line: The command line used to create the process.
+ :vartype command_line: str
+ :ivar creation_time_utc: The time when the process started to run.
+ :vartype creation_time_utc: ~datetime.datetime
+ :ivar elevation_token: The elevation token associated with the process. Known values are:
+ "Default", "Full", and "Limited".
+ :vartype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
+ :ivar host_entity_id: The host entity id on which the process was running.
+ :vartype host_entity_id: str
+ :ivar host_logon_session_entity_id: The session entity id in which the process was running.
+ :vartype host_logon_session_entity_id: str
+ :ivar image_file_entity_id: Image file entity id.
+ :vartype image_file_entity_id: str
+ :ivar parent_process_entity_id: The parent process entity id.
+ :vartype parent_process_entity_id: str
+ :ivar process_id: The process ID.
+ :vartype process_id: str
"""
_validation = {
- "state": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "account_entity_id": {"readonly": True},
+ "command_line": {"readonly": True},
+ "creation_time_utc": {"readonly": True},
+ "host_entity_id": {"readonly": True},
+ "host_logon_session_entity_id": {"readonly": True},
+ "image_file_entity_id": {"readonly": True},
+ "parent_process_entity_id": {"readonly": True},
+ "process_id": {"readonly": True},
}
_attribute_map = {
- "state": {"key": "state", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "account_entity_id": {"key": "accountEntityId", "type": "str"},
+ "command_line": {"key": "commandLine", "type": "str"},
+ "creation_time_utc": {"key": "creationTimeUtc", "type": "iso-8601"},
+ "elevation_token": {"key": "elevationToken", "type": "str"},
+ "host_entity_id": {"key": "hostEntityId", "type": "str"},
+ "host_logon_session_entity_id": {"key": "hostLogonSessionEntityId", "type": "str"},
+ "image_file_entity_id": {"key": "imageFileEntityId", "type": "str"},
+ "parent_process_entity_id": {"key": "parentProcessEntityId", "type": "str"},
+ "process_id": {"key": "processId", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(
+ self, *, elevation_token: Optional[Union[str, "_models.ElevationToken"]] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :keyword elevation_token: The elevation token associated with the process. Known values are:
+ "Default", "Full", and "Limited".
+ :paramtype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
"""
- super().__init__(state=state, **kwargs)
-
+ super().__init__(**kwargs)
+ self.account_entity_id = None
+ self.command_line = None
+ self.creation_time_utc = None
+ self.elevation_token = elevation_token
+ self.host_entity_id = None
+ self.host_logon_session_entity_id = None
+ self.image_file_entity_id = None
+ self.parent_process_entity_id = None
+ self.process_id = None
-class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon):
- """SharePoint data type connection.
- All required parameters must be populated in order to send to Azure.
+class ProductPackageAdditionalProperties(_serialization.Model):
+ """product package additional properties.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :ivar installed_version: The version of the installed package, null or absent means not
+ installed.
+ :vartype installed_version: str
+ :ivar metadata_resource_id: The metadata resource id.
+ :vartype metadata_resource_id: str
+ :ivar packaged_content: The json of the ARM template to deploy. Expandable.
+ :vartype packaged_content: JSON
"""
- _validation = {
- "state": {"required": True},
- }
-
_attribute_map = {
- "state": {"key": "state", "type": "str"},
+ "installed_version": {"key": "installedVersion", "type": "str"},
+ "metadata_resource_id": {"key": "metadataResourceId", "type": "str"},
+ "packaged_content": {"key": "packagedContent", "type": "object"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(
+ self,
+ *,
+ installed_version: Optional[str] = None,
+ metadata_resource_id: Optional[str] = None,
+ packaged_content: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :keyword installed_version: The version of the installed package, null or absent means not
+ installed.
+ :paramtype installed_version: str
+ :keyword metadata_resource_id: The metadata resource id.
+ :paramtype metadata_resource_id: str
+ :keyword packaged_content: The json of the ARM template to deploy. Expandable.
+ :paramtype packaged_content: JSON
"""
- super().__init__(state=state, **kwargs)
+ super().__init__(**kwargs)
+ self.installed_version = installed_version
+ self.metadata_resource_id = metadata_resource_id
+ self.packaged_content = packaged_content
-class OfficeDataConnectorDataTypesTeams(DataConnectorDataTypeCommon):
- """Teams data type connection.
+class ProductPackageList(_serialization.Model):
+ """List available packages.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ All required parameters must be populated in order to send to server.
+
+ :ivar next_link: URL to fetch the next set of packages.
+ :vartype next_link: str
+ :ivar value: Array of packages. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.ProductPackageModel]
"""
_validation = {
- "state": {"required": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "state": {"key": "state", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[ProductPackageModel]"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(self, *, value: List["_models.ProductPackageModel"], **kwargs: Any) -> None:
"""
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :keyword value: Array of packages. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.ProductPackageModel]
"""
- super().__init__(state=state, **kwargs)
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class OfficeDataConnectorProperties(DataConnectorTenantId):
- """Office data connector properties.
+class ProductPackageModel(ResourceWithEtag):
+ """Represents a Package in Azure Security Insights.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar content_id: The content id of the package.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :vartype content_product_id: str
+ :ivar content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar content_schema_version: The version of the content schema.
+ :vartype content_schema_version: str
+ :ivar is_new: Flag indicates if this is a newly published package. Known values are: "true" and
+ "false".
+ :vartype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :vartype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_featured: Flag indicates if this package is among the featured list. Known values are:
+ "true" and "false".
+ :vartype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar version: the latest version number of the package.
+ :vartype version: str
+ :ivar display_name: The display name of the package.
+ :vartype display_name: str
+ :ivar description: The description of the package.
+ :vartype description: str
+ :ivar publisher_display_name: The publisher display name of the package.
+ :vartype publisher_display_name: str
+ :ivar source: The source of the package.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The author of the package.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: The support tier of the package.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: The support tier of the package.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar providers: Providers for the package item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date package item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the package item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar categories: The categories of the package.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ :ivar installed_version: The version of the installed package, null or absent means not
+ installed.
+ :vartype installed_version: str
+ :ivar metadata_resource_id: The metadata resource id.
+ :vartype metadata_resource_id: str
+ :ivar packaged_content: The json of the ARM template to deploy. Expandable.
+ :vartype packaged_content: JSON
"""
_validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "OfficeDataConnectorDataTypes"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "content_id": {"key": "properties.contentId", "type": "str"},
+ "content_product_id": {"key": "properties.contentProductId", "type": "str"},
+ "content_kind": {"key": "properties.contentKind", "type": "str"},
+ "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
+ "is_new": {"key": "properties.isNew", "type": "str"},
+ "is_preview": {"key": "properties.isPreview", "type": "str"},
+ "is_featured": {"key": "properties.isFeatured", "type": "str"},
+ "is_deprecated": {"key": "properties.isDeprecated", "type": "str"},
+ "version": {"key": "properties.version", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "publisher_display_name": {"key": "properties.publisherDisplayName", "type": "str"},
+ "source": {"key": "properties.source", "type": "MetadataSource"},
+ "author": {"key": "properties.author", "type": "MetadataAuthor"},
+ "support": {"key": "properties.support", "type": "MetadataSupport"},
+ "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
+ "providers": {"key": "properties.providers", "type": "[str]"},
+ "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
+ "categories": {"key": "properties.categories", "type": "MetadataCategories"},
+ "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
+ "icon": {"key": "properties.icon", "type": "str"},
+ "installed_version": {"key": "properties.installedVersion", "type": "str"},
+ "metadata_resource_id": {"key": "properties.metadataResourceId", "type": "str"},
+ "packaged_content": {"key": "properties.packagedContent", "type": "object"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.OfficeDataConnectorDataTypes", **kwargs):
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ etag: Optional[str] = None,
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ content_schema_version: Optional[str] = None,
+ is_new: Optional[Union[str, "_models.Flag"]] = None,
+ is_preview: Optional[Union[str, "_models.Flag"]] = None,
+ is_featured: Optional[Union[str, "_models.Flag"]] = None,
+ is_deprecated: Optional[Union[str, "_models.Flag"]] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ description: Optional[str] = None,
+ publisher_display_name: Optional[str] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ icon: Optional[str] = None,
+ installed_version: Optional[str] = None,
+ metadata_resource_id: Optional[str] = None,
+ packaged_content: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword content_id: The content id of the package.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :paramtype content_product_id: str
+ :keyword content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword content_schema_version: The version of the content schema.
+ :paramtype content_schema_version: str
+ :keyword is_new: Flag indicates if this is a newly published package. Known values are: "true"
+ and "false".
+ :paramtype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :paramtype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_featured: Flag indicates if this package is among the featured list. Known values
+ are: "true" and "false".
+ :paramtype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :paramtype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword version: the latest version number of the package.
+ :paramtype version: str
+ :keyword display_name: The display name of the package.
+ :paramtype display_name: str
+ :keyword description: The description of the package.
+ :paramtype description: str
+ :keyword publisher_display_name: The publisher display name of the package.
+ :paramtype publisher_display_name: str
+ :keyword source: The source of the package.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The author of the package.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: The support tier of the package.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: The support tier of the package.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword providers: Providers for the package item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date package item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the package item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword categories: The categories of the package.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ :keyword installed_version: The version of the installed package, null or absent means not
+ installed.
+ :paramtype installed_version: str
+ :keyword metadata_resource_id: The metadata resource id.
+ :paramtype metadata_resource_id: str
+ :keyword packaged_content: The json of the ARM template to deploy. Expandable.
+ :paramtype packaged_content: JSON
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
+ super().__init__(etag=etag, **kwargs)
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.content_kind = content_kind
+ self.content_schema_version = content_schema_version
+ self.is_new = is_new
+ self.is_preview = is_preview
+ self.is_featured = is_featured
+ self.is_deprecated = is_deprecated
+ self.version = version
+ self.display_name = display_name
+ self.description = description
+ self.publisher_display_name = publisher_display_name
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.categories = categories
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.icon = icon
+ self.installed_version = installed_version
+ self.metadata_resource_id = metadata_resource_id
+ self.packaged_content = packaged_content
+
+
+class ProductPackageProperties(PackageBaseProperties, ProductPackageAdditionalProperties):
+ """Describes package properties.
+
+ :ivar installed_version: The version of the installed package, null or absent means not
+ installed.
+ :vartype installed_version: str
+ :ivar metadata_resource_id: The metadata resource id.
+ :vartype metadata_resource_id: str
+ :ivar packaged_content: The json of the ARM template to deploy. Expandable.
+ :vartype packaged_content: JSON
+ :ivar content_id: The content id of the package.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :vartype content_product_id: str
+ :ivar content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar content_schema_version: The version of the content schema.
+ :vartype content_schema_version: str
+ :ivar is_new: Flag indicates if this is a newly published package. Known values are: "true" and
+ "false".
+ :vartype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :vartype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_featured: Flag indicates if this package is among the featured list. Known values are:
+ "true" and "false".
+ :vartype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar version: the latest version number of the package.
+ :vartype version: str
+ :ivar display_name: The display name of the package.
+ :vartype display_name: str
+ :ivar description: The description of the package.
+ :vartype description: str
+ :ivar publisher_display_name: The publisher display name of the package.
+ :vartype publisher_display_name: str
+ :ivar source: The source of the package.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The author of the package.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: The support tier of the package.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: The support tier of the package.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar providers: Providers for the package item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date package item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the package item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar categories: The categories of the package.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ """
+
+ _attribute_map = {
+ "installed_version": {"key": "installedVersion", "type": "str"},
+ "metadata_resource_id": {"key": "metadataResourceId", "type": "str"},
+ "packaged_content": {"key": "packagedContent", "type": "object"},
+ "content_id": {"key": "contentId", "type": "str"},
+ "content_product_id": {"key": "contentProductId", "type": "str"},
+ "content_kind": {"key": "contentKind", "type": "str"},
+ "content_schema_version": {"key": "contentSchemaVersion", "type": "str"},
+ "is_new": {"key": "isNew", "type": "str"},
+ "is_preview": {"key": "isPreview", "type": "str"},
+ "is_featured": {"key": "isFeatured", "type": "str"},
+ "is_deprecated": {"key": "isDeprecated", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "publisher_display_name": {"key": "publisherDisplayName", "type": "str"},
+ "source": {"key": "source", "type": "MetadataSource"},
+ "author": {"key": "author", "type": "MetadataAuthor"},
+ "support": {"key": "support", "type": "MetadataSupport"},
+ "dependencies": {"key": "dependencies", "type": "MetadataDependencies"},
+ "providers": {"key": "providers", "type": "[str]"},
+ "first_publish_date": {"key": "firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "lastPublishDate", "type": "date"},
+ "categories": {"key": "categories", "type": "MetadataCategories"},
+ "threat_analysis_tactics": {"key": "threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "threatAnalysisTechniques", "type": "[str]"},
+ "icon": {"key": "icon", "type": "str"},
+ }
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ installed_version: Optional[str] = None,
+ metadata_resource_id: Optional[str] = None,
+ packaged_content: Optional[JSON] = None,
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ content_schema_version: Optional[str] = None,
+ is_new: Optional[Union[str, "_models.Flag"]] = None,
+ is_preview: Optional[Union[str, "_models.Flag"]] = None,
+ is_featured: Optional[Union[str, "_models.Flag"]] = None,
+ is_deprecated: Optional[Union[str, "_models.Flag"]] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ description: Optional[str] = None,
+ publisher_display_name: Optional[str] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ icon: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword installed_version: The version of the installed package, null or absent means not
+ installed.
+ :paramtype installed_version: str
+ :keyword metadata_resource_id: The metadata resource id.
+ :paramtype metadata_resource_id: str
+ :keyword packaged_content: The json of the ARM template to deploy. Expandable.
+ :paramtype packaged_content: JSON
+ :keyword content_id: The content id of the package.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId, contentKind and the contentVersion of the package.
+ :paramtype content_product_id: str
+ :keyword content_kind: The package kind. Known values are: "Solution" and "Standalone".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword content_schema_version: The version of the content schema.
+ :paramtype content_schema_version: str
+ :keyword is_new: Flag indicates if this is a newly published package. Known values are: "true"
+ and "false".
+ :paramtype is_new: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_preview: Flag indicates if this package is in preview. Known values are: "true" and
+ "false".
+ :paramtype is_preview: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_featured: Flag indicates if this package is among the featured list. Known values
+ are: "true" and "false".
+ :paramtype is_featured: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :paramtype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :keyword version: the latest version number of the package.
+ :paramtype version: str
+ :keyword display_name: The display name of the package.
+ :paramtype display_name: str
+ :keyword description: The description of the package.
+ :paramtype description: str
+ :keyword publisher_display_name: The publisher display name of the package.
+ :paramtype publisher_display_name: str
+ :keyword source: The source of the package.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The author of the package.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: The support tier of the package.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: The support tier of the package.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword providers: Providers for the package item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date package item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the package item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword categories: The categories of the package.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ """
+ super().__init__(
+ content_id=content_id,
+ content_product_id=content_product_id,
+ content_kind=content_kind,
+ content_schema_version=content_schema_version,
+ is_new=is_new,
+ is_preview=is_preview,
+ is_featured=is_featured,
+ is_deprecated=is_deprecated,
+ version=version,
+ display_name=display_name,
+ description=description,
+ publisher_display_name=publisher_display_name,
+ source=source,
+ author=author,
+ support=support,
+ dependencies=dependencies,
+ providers=providers,
+ first_publish_date=first_publish_date,
+ last_publish_date=last_publish_date,
+ categories=categories,
+ threat_analysis_tactics=threat_analysis_tactics,
+ threat_analysis_techniques=threat_analysis_techniques,
+ icon=icon,
+ installed_version=installed_version,
+ metadata_resource_id=metadata_resource_id,
+ packaged_content=packaged_content,
+ **kwargs
+ )
+ self.installed_version = installed_version
+ self.metadata_resource_id = metadata_resource_id
+ self.packaged_content = packaged_content
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.content_kind = content_kind
+ self.content_schema_version = content_schema_version
+ self.is_new = is_new
+ self.is_preview = is_preview
+ self.is_featured = is_featured
+ self.is_deprecated = is_deprecated
+ self.version = version
+ self.display_name = display_name
+ self.description = description
+ self.publisher_display_name = publisher_display_name
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.categories = categories
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.icon = icon
-class OfficeIRMCheckRequirements(DataConnectorsCheckRequirements):
- """Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request.
- All required parameters must be populated in order to send to Azure.
+class ProductTemplateAdditionalProperties(_serialization.Model):
+ """additional properties of product template.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
+ :ivar packaged_content: The json of the ARM template to deploy.
+ :vartype packaged_content: JSON
"""
- _validation = {
- "kind": {"required": True},
- }
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "packaged_content": {"key": "packagedContent", "type": "object"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(self, *, packaged_content: Optional[JSON] = None, **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword packaged_content: The json of the ARM template to deploy.
+ :paramtype packaged_content: JSON
"""
super().__init__(**kwargs)
- self.kind: str = "OfficeIRM"
- self.tenant_id = tenant_id
+ self.packaged_content = packaged_content
-class OfficeIRMCheckRequirementsProperties(DataConnectorTenantId):
- """OfficeIRM (Microsoft Insider Risk Management) requirements check properties.
+class ProductTemplateList(_serialization.Model):
+ """List of all the template.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar value: Array of templates. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.ProductTemplateModel]
+ :ivar next_link: URL to fetch the next page of template.
+ :vartype next_link: str
"""
_validation = {
- "tenant_id": {"required": True},
+ "value": {"required": True},
+ "next_link": {"readonly": True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "value": {"key": "value", "type": "[ProductTemplateModel]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(self, *, value: List["_models.ProductTemplateModel"], **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword value: Array of templates. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.ProductTemplateModel]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
-class OfficeIRMDataConnector(DataConnector):
- """Represents OfficeIRM (Microsoft Insider Risk Management) data connector.
+class ProductTemplateModel(ResourceWithEtag):
+ """Template resource definition.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -17058,18 +11482,78 @@ class OfficeIRMDataConnector(DataConnector):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :vartype content_product_id: str
+ :ivar package_version: Version of the package. Default and recommended format is numeric (e.g.
+ 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but
+ then we cannot guarantee any version checks.
+ :vartype package_version: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar display_name: The display name of the template.
+ :vartype display_name: str
+ :ivar content_kind: The kind of content the template is for. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the template - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
+ :ivar package_id: the package Id contains this template.
+ :vartype package_id: str
+ :ivar package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :vartype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar package_name: the name of the package contains this template.
+ :vartype package_name: str
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar packaged_content: The json of the ARM template to deploy.
+ :vartype packaged_content: JSON
"""
_validation = {
@@ -17077,7 +11561,7 @@ class OfficeIRMDataConnector(DataConnector):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
+ "is_deprecated": {"readonly": True},
}
_attribute_map = {
@@ -17086,634 +11570,860 @@ class OfficeIRMDataConnector(DataConnector):
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
+ "content_id": {"key": "properties.contentId", "type": "str"},
+ "content_product_id": {"key": "properties.contentProductId", "type": "str"},
+ "package_version": {"key": "properties.packageVersion", "type": "str"},
+ "version": {"key": "properties.version", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "content_kind": {"key": "properties.contentKind", "type": "str"},
+ "source": {"key": "properties.source", "type": "MetadataSource"},
+ "author": {"key": "properties.author", "type": "MetadataAuthor"},
+ "support": {"key": "properties.support", "type": "MetadataSupport"},
+ "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "properties.categories", "type": "MetadataCategories"},
+ "providers": {"key": "properties.providers", "type": "[str]"},
+ "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
+ "custom_version": {"key": "properties.customVersion", "type": "str"},
+ "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
+ "icon": {"key": "properties.icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "properties.previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "properties.previewImagesDark", "type": "[str]"},
+ "package_id": {"key": "properties.packageId", "type": "str"},
+ "package_kind": {"key": "properties.packageKind", "type": "str"},
+ "package_name": {"key": "properties.packageName", "type": "str"},
+ "is_deprecated": {"key": "properties.isDeprecated", "type": "str"},
+ "packaged_content": {"key": "properties.packagedContent", "type": "object"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- **kwargs
- ):
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ package_version: Optional[str] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.Kind"]] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ package_id: Optional[str] = None,
+ package_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ package_name: Optional[str] = None,
+ packaged_content: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "OfficeIRM"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
-
-class OfficeIRMDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """OfficeIRM (Microsoft Insider Risk Management) data connector properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
- """
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, data_types=data_types, **kwargs)
- self.data_types = data_types
- self.tenant_id = tenant_id
-
-
-class OfficePowerBICheckRequirements(DataConnectorsCheckRequirements):
- """Represents Office PowerBI requirements check request.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- """
-
- _validation = {
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- """
- super().__init__(**kwargs)
- self.kind: str = "OfficePowerBI"
- self.tenant_id = tenant_id
-
-
-class OfficePowerBICheckRequirementsProperties(DataConnectorTenantId):
- """Office PowerBI requirements check properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- """
-
- _validation = {
- "tenant_id": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- }
-
- def __init__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
-
-
-class OfficePowerBIConnectorDataTypes(_serialization.Model):
- """The available data types for Office Microsoft PowerBI data connector.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar logs: Logs data type. Required.
- :vartype logs: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypesLogs
- """
-
- _validation = {
- "logs": {"required": True},
- }
-
- _attribute_map = {
- "logs": {"key": "logs", "type": "OfficePowerBIConnectorDataTypesLogs"},
- }
-
- def __init__(self, *, logs: "_models.OfficePowerBIConnectorDataTypesLogs", **kwargs):
- """
- :keyword logs: Logs data type. Required.
- :paramtype logs: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypesLogs
- """
- super().__init__(**kwargs)
- self.logs = logs
-
-
-class OfficePowerBIConnectorDataTypesLogs(DataConnectorDataTypeCommon):
- """Logs data type.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
-
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :paramtype content_product_id: str
+ :keyword package_version: Version of the package. Default and recommended format is numeric
+ (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string,
+ but then we cannot guarantee any version checks.
+ :paramtype package_version: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword display_name: The display name of the template.
+ :paramtype display_name: str
+ :keyword content_kind: The kind of content the template is for. Known values are:
+ "DataConnector", "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the template - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
+ :keyword package_id: the package Id contains this template.
+ :paramtype package_id: str
+ :keyword package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :paramtype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword package_name: the name of the package contains this template.
+ :paramtype package_name: str
+ :keyword packaged_content: The json of the ARM template to deploy.
+ :paramtype packaged_content: JSON
"""
- super().__init__(state=state, **kwargs)
+ super().__init__(etag=etag, **kwargs)
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.package_version = package_version
+ self.version = version
+ self.display_name = display_name
+ self.content_kind = content_kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
+ self.package_id = package_id
+ self.package_kind = package_kind
+ self.package_name = package_name
+ self.is_deprecated = None
+ self.packaged_content = packaged_content
-class OfficePowerBIDataConnector(DataConnector):
- """Represents Office Microsoft PowerBI data connector.
+class TemplateBaseProperties(_serialization.Model):
+ """Template property bag.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypes
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :vartype content_product_id: str
+ :ivar package_version: Version of the package. Default and recommended format is numeric (e.g.
+ 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but
+ then we cannot guarantee any version checks.
+ :vartype package_version: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar display_name: The display name of the template.
+ :vartype display_name: str
+ :ivar content_kind: The kind of content the template is for. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the template - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
+ :ivar package_id: the package Id contains this template.
+ :vartype package_id: str
+ :ivar package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :vartype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar package_name: the name of the package contains this template.
+ :vartype package_name: str
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ "is_deprecated": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "OfficePowerBIConnectorDataTypes"},
+ "content_id": {"key": "contentId", "type": "str"},
+ "content_product_id": {"key": "contentProductId", "type": "str"},
+ "package_version": {"key": "packageVersion", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "content_kind": {"key": "contentKind", "type": "str"},
+ "source": {"key": "source", "type": "MetadataSource"},
+ "author": {"key": "author", "type": "MetadataAuthor"},
+ "support": {"key": "support", "type": "MetadataSupport"},
+ "dependencies": {"key": "dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "categories", "type": "MetadataCategories"},
+ "providers": {"key": "providers", "type": "[str]"},
+ "first_publish_date": {"key": "firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "lastPublishDate", "type": "date"},
+ "custom_version": {"key": "customVersion", "type": "str"},
+ "content_schema_version": {"key": "contentSchemaVersion", "type": "str"},
+ "icon": {"key": "icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "previewImagesDark", "type": "[str]"},
+ "package_id": {"key": "packageId", "type": "str"},
+ "package_kind": {"key": "packageKind", "type": "str"},
+ "package_name": {"key": "packageName", "type": "str"},
+ "is_deprecated": {"key": "isDeprecated", "type": "str"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.OfficePowerBIConnectorDataTypes"] = None,
- **kwargs
- ):
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ package_version: Optional[str] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.Kind"]] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ package_id: Optional[str] = None,
+ package_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ package_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypes
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :paramtype content_product_id: str
+ :keyword package_version: Version of the package. Default and recommended format is numeric
+ (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string,
+ but then we cannot guarantee any version checks.
+ :paramtype package_version: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword display_name: The display name of the template.
+ :paramtype display_name: str
+ :keyword content_kind: The kind of content the template is for. Known values are:
+ "DataConnector", "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the template - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
+ :keyword package_id: the package Id contains this template.
+ :paramtype package_id: str
+ :keyword package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :paramtype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword package_name: the name of the package contains this template.
+ :paramtype package_name: str
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "OfficePowerBI"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.package_version = package_version
+ self.version = version
+ self.display_name = display_name
+ self.content_kind = content_kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
+ self.package_id = package_id
+ self.package_kind = package_kind
+ self.package_name = package_name
+ self.is_deprecated = None
-class OfficePowerBIDataConnectorProperties(DataConnectorTenantId):
- """Office Microsoft PowerBI data connector properties.
- All required parameters must be populated in order to send to Azure.
+class ProductTemplateProperties(TemplateBaseProperties, ProductTemplateAdditionalProperties):
+ """Template property bag.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypes
- """
+ Variables are only populated by the server, and will be ignored when sending a request.
- _validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
- }
+ :ivar packaged_content: The json of the ARM template to deploy.
+ :vartype packaged_content: JSON
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :vartype content_product_id: str
+ :ivar package_version: Version of the package. Default and recommended format is numeric (e.g.
+ 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but
+ then we cannot guarantee any version checks.
+ :vartype package_version: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar display_name: The display name of the template.
+ :vartype display_name: str
+ :ivar content_kind: The kind of content the template is for. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the template - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
+ :ivar package_id: the package Id contains this template.
+ :vartype package_id: str
+ :ivar package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :vartype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar package_name: the name of the package contains this template.
+ :vartype package_name: str
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ """
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "OfficePowerBIConnectorDataTypes"},
+ _validation = {
+ "is_deprecated": {"readonly": True},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.OfficePowerBIConnectorDataTypes", **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypes
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
-
-class Operation(_serialization.Model):
- """Operation provided by provider.
-
- :ivar display: Properties of the operation.
- :vartype display: ~azure.mgmt.securityinsight.models.OperationDisplay
- :ivar name: Name of the operation.
- :vartype name: str
- :ivar origin: The origin of the operation.
- :vartype origin: str
- :ivar is_data_action: Indicates whether the operation is a data action.
- :vartype is_data_action: bool
- """
-
_attribute_map = {
- "display": {"key": "display", "type": "OperationDisplay"},
- "name": {"key": "name", "type": "str"},
- "origin": {"key": "origin", "type": "str"},
- "is_data_action": {"key": "isDataAction", "type": "bool"},
+ "packaged_content": {"key": "packagedContent", "type": "object"},
+ "content_id": {"key": "contentId", "type": "str"},
+ "content_product_id": {"key": "contentProductId", "type": "str"},
+ "package_version": {"key": "packageVersion", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "content_kind": {"key": "contentKind", "type": "str"},
+ "source": {"key": "source", "type": "MetadataSource"},
+ "author": {"key": "author", "type": "MetadataAuthor"},
+ "support": {"key": "support", "type": "MetadataSupport"},
+ "dependencies": {"key": "dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "categories", "type": "MetadataCategories"},
+ "providers": {"key": "providers", "type": "[str]"},
+ "first_publish_date": {"key": "firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "lastPublishDate", "type": "date"},
+ "custom_version": {"key": "customVersion", "type": "str"},
+ "content_schema_version": {"key": "contentSchemaVersion", "type": "str"},
+ "icon": {"key": "icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "previewImagesDark", "type": "[str]"},
+ "package_id": {"key": "packageId", "type": "str"},
+ "package_kind": {"key": "packageKind", "type": "str"},
+ "package_name": {"key": "packageName", "type": "str"},
+ "is_deprecated": {"key": "isDeprecated", "type": "str"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
- display: Optional["_models.OperationDisplay"] = None,
- name: Optional[str] = None,
- origin: Optional[str] = None,
- is_data_action: Optional[bool] = None,
- **kwargs
- ):
- """
- :keyword display: Properties of the operation.
- :paramtype display: ~azure.mgmt.securityinsight.models.OperationDisplay
- :keyword name: Name of the operation.
- :paramtype name: str
- :keyword origin: The origin of the operation.
- :paramtype origin: str
- :keyword is_data_action: Indicates whether the operation is a data action.
- :paramtype is_data_action: bool
+ packaged_content: Optional[JSON] = None,
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ package_version: Optional[str] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.Kind"]] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ package_id: Optional[str] = None,
+ package_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ package_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword packaged_content: The json of the ARM template to deploy.
+ :paramtype packaged_content: JSON
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :paramtype content_product_id: str
+ :keyword package_version: Version of the package. Default and recommended format is numeric
+ (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string,
+ but then we cannot guarantee any version checks.
+ :paramtype package_version: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword display_name: The display name of the template.
+ :paramtype display_name: str
+ :keyword content_kind: The kind of content the template is for. Known values are:
+ "DataConnector", "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the template - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
+ :keyword package_id: the package Id contains this template.
+ :paramtype package_id: str
+ :keyword package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :paramtype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword package_name: the name of the package contains this template.
+ :paramtype package_name: str
"""
- super().__init__(**kwargs)
- self.display = display
- self.name = name
- self.origin = origin
- self.is_data_action = is_data_action
+ super().__init__(
+ content_id=content_id,
+ content_product_id=content_product_id,
+ package_version=package_version,
+ version=version,
+ display_name=display_name,
+ content_kind=content_kind,
+ source=source,
+ author=author,
+ support=support,
+ dependencies=dependencies,
+ categories=categories,
+ providers=providers,
+ first_publish_date=first_publish_date,
+ last_publish_date=last_publish_date,
+ custom_version=custom_version,
+ content_schema_version=content_schema_version,
+ icon=icon,
+ threat_analysis_tactics=threat_analysis_tactics,
+ threat_analysis_techniques=threat_analysis_techniques,
+ preview_images=preview_images,
+ preview_images_dark=preview_images_dark,
+ package_id=package_id,
+ package_kind=package_kind,
+ package_name=package_name,
+ packaged_content=packaged_content,
+ **kwargs
+ )
+ self.packaged_content = packaged_content
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.package_version = package_version
+ self.version = version
+ self.display_name = display_name
+ self.content_kind = content_kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
+ self.package_id = package_id
+ self.package_kind = package_kind
+ self.package_name = package_name
+ self.is_deprecated = None
-class OperationDisplay(_serialization.Model):
- """Properties of the operation.
+class PropertyArrayChangedConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that evaluates an array property's value change.
- :ivar description: Description of the operation.
- :vartype description: str
- :ivar operation: Operation name.
- :vartype operation: str
- :ivar provider: Provider name.
- :vartype provider: str
- :ivar resource: Resource name.
- :vartype resource: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
+ "PropertyChanged", "PropertyArrayChanged", and "Boolean".
+ :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
+ :ivar condition_properties:
+ :vartype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedValuesCondition
"""
+ _validation = {
+ "condition_type": {"required": True},
+ }
+
_attribute_map = {
- "description": {"key": "description", "type": "str"},
- "operation": {"key": "operation", "type": "str"},
- "provider": {"key": "provider", "type": "str"},
- "resource": {"key": "resource", "type": "str"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {
+ "key": "conditionProperties",
+ "type": "AutomationRulePropertyArrayChangedValuesCondition",
+ },
}
def __init__(
self,
*,
- description: Optional[str] = None,
- operation: Optional[str] = None,
- provider: Optional[str] = None,
- resource: Optional[str] = None,
- **kwargs
- ):
+ condition_properties: Optional["_models.AutomationRulePropertyArrayChangedValuesCondition"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword description: Description of the operation.
- :paramtype description: str
- :keyword operation: Operation name.
- :paramtype operation: str
- :keyword provider: Provider name.
- :paramtype provider: str
- :keyword resource: Resource name.
- :paramtype resource: str
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedValuesCondition
"""
super().__init__(**kwargs)
- self.description = description
- self.operation = operation
- self.provider = provider
- self.resource = resource
-
+ self.condition_type: str = "PropertyArrayChanged"
+ self.condition_properties = condition_properties
-class OperationsList(_serialization.Model):
- """Lists the operations available in the SecurityInsights RP.
- Variables are only populated by the server, and will be ignored when sending a request.
+class PropertyArrayConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that evaluates an array property's value.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar next_link: URL to fetch the next set of operations.
- :vartype next_link: str
- :ivar value: Array of operations. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Operation]
+ :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
+ "PropertyChanged", "PropertyArrayChanged", and "Boolean".
+ :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
+ :ivar condition_properties: Describes an automation rule condition on array properties.
+ :vartype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayValuesCondition
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Operation]"},
+ "condition_type": {"required": True},
}
- def __init__(self, *, value: List["_models.Operation"], **kwargs):
- """
- :keyword value: Array of operations. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Operation]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class Permissions(_serialization.Model):
- """Permissions required for the connector.
-
- :ivar resource_provider: Resource provider permissions required for the connector.
- :vartype resource_provider:
- list[~azure.mgmt.securityinsight.models.PermissionsResourceProviderItem]
- :ivar customs: Customs permissions required for the connector.
- :vartype customs: list[~azure.mgmt.securityinsight.models.PermissionsCustomsItem]
- """
-
_attribute_map = {
- "resource_provider": {"key": "resourceProvider", "type": "[PermissionsResourceProviderItem]"},
- "customs": {"key": "customs", "type": "[PermissionsCustomsItem]"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyArrayValuesCondition"},
}
def __init__(
self,
*,
- resource_provider: Optional[List["_models.PermissionsResourceProviderItem"]] = None,
- customs: Optional[List["_models.PermissionsCustomsItem"]] = None,
- **kwargs
- ):
+ condition_properties: Optional["_models.AutomationRulePropertyArrayValuesCondition"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword resource_provider: Resource provider permissions required for the connector.
- :paramtype resource_provider:
- list[~azure.mgmt.securityinsight.models.PermissionsResourceProviderItem]
- :keyword customs: Customs permissions required for the connector.
- :paramtype customs: list[~azure.mgmt.securityinsight.models.PermissionsCustomsItem]
+ :keyword condition_properties: Describes an automation rule condition on array properties.
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayValuesCondition
"""
super().__init__(**kwargs)
- self.resource_provider = resource_provider
- self.customs = customs
-
-
-class PermissionsCustomsItem(Customs):
- """PermissionsCustomsItem.
-
- :ivar name: Customs permissions name.
- :vartype name: str
- :ivar description: Customs permissions description.
- :vartype description: str
- """
-
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
- }
+ self.condition_type: str = "PropertyArray"
+ self.condition_properties = condition_properties
- def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs):
- """
- :keyword name: Customs permissions name.
- :paramtype name: str
- :keyword description: Customs permissions description.
- :paramtype description: str
- """
- super().__init__(name=name, description=description, **kwargs)
+class PropertyChangedConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that evaluates a property's value change.
-class ResourceProvider(_serialization.Model):
- """Resource provider permissions required for the connector.
+ All required parameters must be populated in order to send to server.
- :ivar provider: Provider name. Known values are: "Microsoft.OperationalInsights/solutions",
- "Microsoft.OperationalInsights/workspaces",
- "Microsoft.OperationalInsights/workspaces/datasources", "microsoft.aadiam/diagnosticSettings",
- "Microsoft.OperationalInsights/workspaces/sharedKeys", and
- "Microsoft.Authorization/policyAssignments".
- :vartype provider: str or ~azure.mgmt.securityinsight.models.ProviderName
- :ivar permissions_display_text: Permission description text.
- :vartype permissions_display_text: str
- :ivar provider_display_name: Permission provider display name.
- :vartype provider_display_name: str
- :ivar scope: Permission provider scope. Known values are: "ResourceGroup", "Subscription", and
- "Workspace".
- :vartype scope: str or ~azure.mgmt.securityinsight.models.PermissionProviderScope
- :ivar required_permissions: Required permissions for the connector.
- :vartype required_permissions: ~azure.mgmt.securityinsight.models.RequiredPermissions
+ :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
+ "PropertyChanged", "PropertyArrayChanged", and "Boolean".
+ :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
+ :ivar condition_properties:
+ :vartype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesChangedCondition
"""
+ _validation = {
+ "condition_type": {"required": True},
+ }
+
_attribute_map = {
- "provider": {"key": "provider", "type": "str"},
- "permissions_display_text": {"key": "permissionsDisplayText", "type": "str"},
- "provider_display_name": {"key": "providerDisplayName", "type": "str"},
- "scope": {"key": "scope", "type": "str"},
- "required_permissions": {"key": "requiredPermissions", "type": "RequiredPermissions"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesChangedCondition"},
}
def __init__(
self,
*,
- provider: Optional[Union[str, "_models.ProviderName"]] = None,
- permissions_display_text: Optional[str] = None,
- provider_display_name: Optional[str] = None,
- scope: Optional[Union[str, "_models.PermissionProviderScope"]] = None,
- required_permissions: Optional["_models.RequiredPermissions"] = None,
- **kwargs
- ):
- """
- :keyword provider: Provider name. Known values are: "Microsoft.OperationalInsights/solutions",
- "Microsoft.OperationalInsights/workspaces",
- "Microsoft.OperationalInsights/workspaces/datasources", "microsoft.aadiam/diagnosticSettings",
- "Microsoft.OperationalInsights/workspaces/sharedKeys", and
- "Microsoft.Authorization/policyAssignments".
- :paramtype provider: str or ~azure.mgmt.securityinsight.models.ProviderName
- :keyword permissions_display_text: Permission description text.
- :paramtype permissions_display_text: str
- :keyword provider_display_name: Permission provider display name.
- :paramtype provider_display_name: str
- :keyword scope: Permission provider scope. Known values are: "ResourceGroup", "Subscription",
- and "Workspace".
- :paramtype scope: str or ~azure.mgmt.securityinsight.models.PermissionProviderScope
- :keyword required_permissions: Required permissions for the connector.
- :paramtype required_permissions: ~azure.mgmt.securityinsight.models.RequiredPermissions
+ condition_properties: Optional["_models.AutomationRulePropertyValuesChangedCondition"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesChangedCondition
"""
super().__init__(**kwargs)
- self.provider = provider
- self.permissions_display_text = permissions_display_text
- self.provider_display_name = provider_display_name
- self.scope = scope
- self.required_permissions = required_permissions
+ self.condition_type: str = "PropertyChanged"
+ self.condition_properties = condition_properties
-class PermissionsResourceProviderItem(ResourceProvider):
- """PermissionsResourceProviderItem.
+class PropertyConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that evaluates a property's value.
- :ivar provider: Provider name. Known values are: "Microsoft.OperationalInsights/solutions",
- "Microsoft.OperationalInsights/workspaces",
- "Microsoft.OperationalInsights/workspaces/datasources", "microsoft.aadiam/diagnosticSettings",
- "Microsoft.OperationalInsights/workspaces/sharedKeys", and
- "Microsoft.Authorization/policyAssignments".
- :vartype provider: str or ~azure.mgmt.securityinsight.models.ProviderName
- :ivar permissions_display_text: Permission description text.
- :vartype permissions_display_text: str
- :ivar provider_display_name: Permission provider display name.
- :vartype provider_display_name: str
- :ivar scope: Permission provider scope. Known values are: "ResourceGroup", "Subscription", and
- "Workspace".
- :vartype scope: str or ~azure.mgmt.securityinsight.models.PermissionProviderScope
- :ivar required_permissions: Required permissions for the connector.
- :vartype required_permissions: ~azure.mgmt.securityinsight.models.RequiredPermissions
+ All required parameters must be populated in order to send to server.
+
+ :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
+ "PropertyChanged", "PropertyArrayChanged", and "Boolean".
+ :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
+ :ivar condition_properties:
+ :vartype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesCondition
"""
+ _validation = {
+ "condition_type": {"required": True},
+ }
+
_attribute_map = {
- "provider": {"key": "provider", "type": "str"},
- "permissions_display_text": {"key": "permissionsDisplayText", "type": "str"},
- "provider_display_name": {"key": "providerDisplayName", "type": "str"},
- "scope": {"key": "scope", "type": "str"},
- "required_permissions": {"key": "requiredPermissions", "type": "RequiredPermissions"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesCondition"},
}
def __init__(
- self,
- *,
- provider: Optional[Union[str, "_models.ProviderName"]] = None,
- permissions_display_text: Optional[str] = None,
- provider_display_name: Optional[str] = None,
- scope: Optional[Union[str, "_models.PermissionProviderScope"]] = None,
- required_permissions: Optional["_models.RequiredPermissions"] = None,
- **kwargs
- ):
- """
- :keyword provider: Provider name. Known values are: "Microsoft.OperationalInsights/solutions",
- "Microsoft.OperationalInsights/workspaces",
- "Microsoft.OperationalInsights/workspaces/datasources", "microsoft.aadiam/diagnosticSettings",
- "Microsoft.OperationalInsights/workspaces/sharedKeys", and
- "Microsoft.Authorization/policyAssignments".
- :paramtype provider: str or ~azure.mgmt.securityinsight.models.ProviderName
- :keyword permissions_display_text: Permission description text.
- :paramtype permissions_display_text: str
- :keyword provider_display_name: Permission provider display name.
- :paramtype provider_display_name: str
- :keyword scope: Permission provider scope. Known values are: "ResourceGroup", "Subscription",
- and "Workspace".
- :paramtype scope: str or ~azure.mgmt.securityinsight.models.PermissionProviderScope
- :keyword required_permissions: Required permissions for the connector.
- :paramtype required_permissions: ~azure.mgmt.securityinsight.models.RequiredPermissions
+ self, *, condition_properties: Optional["_models.AutomationRulePropertyValuesCondition"] = None, **kwargs: Any
+ ) -> None:
"""
- super().__init__(
- provider=provider,
- permissions_display_text=permissions_display_text,
- provider_display_name=provider_display_name,
- scope=scope,
- required_permissions=required_permissions,
- **kwargs
- )
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesCondition
+ """
+ super().__init__(**kwargs)
+ self.condition_type: str = "Property"
+ self.condition_properties = condition_properties
-class PlaybookActionProperties(_serialization.Model):
- """PlaybookActionProperties.
+class PullRequest(_serialization.Model):
+ """Information regarding pull request for protected branches.
- :ivar logic_app_resource_id: The resource id of the playbook resource.
- :vartype logic_app_resource_id: str
- :ivar tenant_id: The tenant id of the playbook resource.
- :vartype tenant_id: str
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar url: URL of pull request.
+ :vartype url: str
+ :ivar state: State of the pull request. Known values are: "Open" and "Closed".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.State
"""
+ _validation = {
+ "url": {"readonly": True},
+ "state": {"readonly": True},
+ }
+
_attribute_map = {
- "logic_app_resource_id": {"key": "logicAppResourceId", "type": "str"},
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "url": {"key": "url", "type": "str"},
+ "state": {"key": "state", "type": "str"},
}
- def __init__(self, *, logic_app_resource_id: Optional[str] = None, tenant_id: Optional[str] = None, **kwargs):
- """
- :keyword logic_app_resource_id: The resource id of the playbook resource.
- :paramtype logic_app_resource_id: str
- :keyword tenant_id: The tenant id of the playbook resource.
- :paramtype tenant_id: str
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.logic_app_resource_id = logic_app_resource_id
- self.tenant_id = tenant_id
+ self.url = None
+ self.state = None
-class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a process entity.
+class RegistryKeyEntity(Entity):
+ """Represents a registry key entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -17726,33 +12436,21 @@ class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
:ivar friendly_name: The graph item display name which is a short humanly readable description
of the graph item instance. This property is optional and might be system generated.
:vartype friendly_name: str
- :ivar account_entity_id: The account entity id running the processes.
- :vartype account_entity_id: str
- :ivar command_line: The command line used to create the process.
- :vartype command_line: str
- :ivar creation_time_utc: The time when the process started to run.
- :vartype creation_time_utc: ~datetime.datetime
- :ivar elevation_token: The elevation token associated with the process. Known values are:
- "Default", "Full", and "Limited".
- :vartype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
- :ivar host_entity_id: The host entity id on which the process was running.
- :vartype host_entity_id: str
- :ivar host_logon_session_entity_id: The session entity id in which the process was running.
- :vartype host_logon_session_entity_id: str
- :ivar image_file_entity_id: Image file entity id.
- :vartype image_file_entity_id: str
- :ivar parent_process_entity_id: The parent process entity id.
- :vartype parent_process_entity_id: str
- :ivar process_id: The process ID.
- :vartype process_id: str
+ :ivar hive: the hive that holds the registry key. Known values are: "HKEY_LOCAL_MACHINE",
+ "HKEY_CLASSES_ROOT", "HKEY_CURRENT_CONFIG", "HKEY_USERS", "HKEY_CURRENT_USER_LOCAL_SETTINGS",
+ "HKEY_PERFORMANCE_DATA", "HKEY_PERFORMANCE_NLSTEXT", "HKEY_PERFORMANCE_TEXT", "HKEY_A", and
+ "HKEY_CURRENT_USER".
+ :vartype hive: str or ~azure.mgmt.securityinsight.models.RegistryHive
+ :ivar key: The registry key path.
+ :vartype key: str
"""
_validation = {
@@ -17763,14 +12461,8 @@ class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"required": True},
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
- "account_entity_id": {"readonly": True},
- "command_line": {"readonly": True},
- "creation_time_utc": {"readonly": True},
- "host_entity_id": {"readonly": True},
- "host_logon_session_entity_id": {"readonly": True},
- "image_file_entity_id": {"readonly": True},
- "parent_process_entity_id": {"readonly": True},
- "process_id": {"readonly": True},
+ "hive": {"readonly": True},
+ "key": {"readonly": True},
}
_attribute_map = {
@@ -17781,792 +12473,651 @@ class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
"kind": {"key": "kind", "type": "str"},
"additional_data": {"key": "properties.additionalData", "type": "{object}"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "account_entity_id": {"key": "properties.accountEntityId", "type": "str"},
- "command_line": {"key": "properties.commandLine", "type": "str"},
- "creation_time_utc": {"key": "properties.creationTimeUtc", "type": "iso-8601"},
- "elevation_token": {"key": "properties.elevationToken", "type": "str"},
- "host_entity_id": {"key": "properties.hostEntityId", "type": "str"},
- "host_logon_session_entity_id": {"key": "properties.hostLogonSessionEntityId", "type": "str"},
- "image_file_entity_id": {"key": "properties.imageFileEntityId", "type": "str"},
- "parent_process_entity_id": {"key": "properties.parentProcessEntityId", "type": "str"},
- "process_id": {"key": "properties.processId", "type": "str"},
- }
-
- def __init__(self, *, elevation_token: Optional[Union[str, "_models.ElevationToken"]] = None, **kwargs):
- """
- :keyword elevation_token: The elevation token associated with the process. Known values are:
- "Default", "Full", and "Limited".
- :paramtype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
- """
- super().__init__(**kwargs)
- self.kind: str = "Process"
- self.additional_data = None
- self.friendly_name = None
- self.account_entity_id = None
- self.command_line = None
- self.creation_time_utc = None
- self.elevation_token = elevation_token
- self.host_entity_id = None
- self.host_logon_session_entity_id = None
- self.image_file_entity_id = None
- self.parent_process_entity_id = None
- self.process_id = None
-
-
-class ProcessEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Process entity property bag.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar account_entity_id: The account entity id running the processes.
- :vartype account_entity_id: str
- :ivar command_line: The command line used to create the process.
- :vartype command_line: str
- :ivar creation_time_utc: The time when the process started to run.
- :vartype creation_time_utc: ~datetime.datetime
- :ivar elevation_token: The elevation token associated with the process. Known values are:
- "Default", "Full", and "Limited".
- :vartype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
- :ivar host_entity_id: The host entity id on which the process was running.
- :vartype host_entity_id: str
- :ivar host_logon_session_entity_id: The session entity id in which the process was running.
- :vartype host_logon_session_entity_id: str
- :ivar image_file_entity_id: Image file entity id.
- :vartype image_file_entity_id: str
- :ivar parent_process_entity_id: The parent process entity id.
- :vartype parent_process_entity_id: str
- :ivar process_id: The process ID.
- :vartype process_id: str
- """
-
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "account_entity_id": {"readonly": True},
- "command_line": {"readonly": True},
- "creation_time_utc": {"readonly": True},
- "host_entity_id": {"readonly": True},
- "host_logon_session_entity_id": {"readonly": True},
- "image_file_entity_id": {"readonly": True},
- "parent_process_entity_id": {"readonly": True},
- "process_id": {"readonly": True},
- }
-
- _attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "account_entity_id": {"key": "accountEntityId", "type": "str"},
- "command_line": {"key": "commandLine", "type": "str"},
- "creation_time_utc": {"key": "creationTimeUtc", "type": "iso-8601"},
- "elevation_token": {"key": "elevationToken", "type": "str"},
- "host_entity_id": {"key": "hostEntityId", "type": "str"},
- "host_logon_session_entity_id": {"key": "hostLogonSessionEntityId", "type": "str"},
- "image_file_entity_id": {"key": "imageFileEntityId", "type": "str"},
- "parent_process_entity_id": {"key": "parentProcessEntityId", "type": "str"},
- "process_id": {"key": "processId", "type": "str"},
- }
-
- def __init__(self, *, elevation_token: Optional[Union[str, "_models.ElevationToken"]] = None, **kwargs):
- """
- :keyword elevation_token: The elevation token associated with the process. Known values are:
- "Default", "Full", and "Limited".
- :paramtype elevation_token: str or ~azure.mgmt.securityinsight.models.ElevationToken
- """
- super().__init__(**kwargs)
- self.account_entity_id = None
- self.command_line = None
- self.creation_time_utc = None
- self.elevation_token = elevation_token
- self.host_entity_id = None
- self.host_logon_session_entity_id = None
- self.image_file_entity_id = None
- self.parent_process_entity_id = None
- self.process_id = None
-
-
-class PropertyArrayChangedConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates an array property's value change.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
- "PropertyChanged", "PropertyArrayChanged", and "Boolean".
- :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
- :ivar condition_properties:
- :vartype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedValuesCondition
- """
-
- _validation = {
- "condition_type": {"required": True},
- }
-
- _attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {
- "key": "conditionProperties",
- "type": "AutomationRulePropertyArrayChangedValuesCondition",
- },
+ "hive": {"key": "properties.hive", "type": "str"},
+ "key": {"key": "properties.key", "type": "str"},
}
- def __init__(
- self,
- *,
- condition_properties: Optional["_models.AutomationRulePropertyArrayChangedValuesCondition"] = None,
- **kwargs
- ):
- """
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedValuesCondition
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.condition_type: str = "PropertyArrayChanged"
- self.condition_properties = condition_properties
+ self.kind: str = "RegistryKey"
+ self.additional_data = None
+ self.friendly_name = None
+ self.hive = None
+ self.key = None
-class PropertyArrayConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates an array property's value.
+class RegistryKeyEntityProperties(EntityCommonProperties):
+ """RegistryKey entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
- "PropertyChanged", "PropertyArrayChanged", and "Boolean".
- :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
- :ivar condition_properties:
- :vartype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayValuesCondition
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar hive: the hive that holds the registry key. Known values are: "HKEY_LOCAL_MACHINE",
+ "HKEY_CLASSES_ROOT", "HKEY_CURRENT_CONFIG", "HKEY_USERS", "HKEY_CURRENT_USER_LOCAL_SETTINGS",
+ "HKEY_PERFORMANCE_DATA", "HKEY_PERFORMANCE_NLSTEXT", "HKEY_PERFORMANCE_TEXT", "HKEY_A", and
+ "HKEY_CURRENT_USER".
+ :vartype hive: str or ~azure.mgmt.securityinsight.models.RegistryHive
+ :ivar key: The registry key path.
+ :vartype key: str
"""
_validation = {
- "condition_type": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "hive": {"readonly": True},
+ "key": {"readonly": True},
}
_attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyArrayValuesCondition"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "hive": {"key": "hive", "type": "str"},
+ "key": {"key": "key", "type": "str"},
}
- def __init__(
- self, *, condition_properties: Optional["_models.AutomationRulePropertyArrayValuesCondition"] = None, **kwargs
- ):
- """
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayValuesCondition
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.condition_type: str = "PropertyArray"
- self.condition_properties = condition_properties
+ self.hive = None
+ self.key = None
-class PropertyChangedConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates a property's value change.
+class RegistryValueEntity(Entity):
+ """Represents a registry value entity.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
- "PropertyChanged", "PropertyArrayChanged", and "Boolean".
- :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
- :ivar condition_properties:
- :vartype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesChangedCondition
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
+ "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
+ "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar key_entity_id: The registry key entity id.
+ :vartype key_entity_id: str
+ :ivar value_data: String formatted representation of the value data.
+ :vartype value_data: str
+ :ivar value_name: The registry value name.
+ :vartype value_name: str
+ :ivar value_type: Specifies the data types to use when storing values in the registry, or
+ identifies the data type of a value in the registry. Known values are: "None", "Unknown",
+ "String", "ExpandString", "Binary", "DWord", "MultiString", and "QWord".
+ :vartype value_type: str or ~azure.mgmt.securityinsight.models.RegistryValueKind
"""
_validation = {
- "condition_type": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "key_entity_id": {"readonly": True},
+ "value_data": {"readonly": True},
+ "value_name": {"readonly": True},
+ "value_type": {"readonly": True},
}
_attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesChangedCondition"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "kind": {"key": "kind", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "key_entity_id": {"key": "properties.keyEntityId", "type": "str"},
+ "value_data": {"key": "properties.valueData", "type": "str"},
+ "value_name": {"key": "properties.valueName", "type": "str"},
+ "value_type": {"key": "properties.valueType", "type": "str"},
}
- def __init__(
- self, *, condition_properties: Optional["_models.AutomationRulePropertyValuesChangedCondition"] = None, **kwargs
- ):
- """
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesChangedCondition
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.condition_type: str = "PropertyChanged"
- self.condition_properties = condition_properties
+ self.kind: str = "RegistryValue"
+ self.additional_data = None
+ self.friendly_name = None
+ self.key_entity_id = None
+ self.value_data = None
+ self.value_name = None
+ self.value_type = None
-class PropertyConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates a property's value.
+class RegistryValueEntityProperties(EntityCommonProperties):
+ """RegistryValue entity property bag.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar condition_type: Required. Known values are: "Property", "PropertyArray",
- "PropertyChanged", "PropertyArrayChanged", and "Boolean".
- :vartype condition_type: str or ~azure.mgmt.securityinsight.models.ConditionType
- :ivar condition_properties:
- :vartype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesCondition
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar key_entity_id: The registry key entity id.
+ :vartype key_entity_id: str
+ :ivar value_data: String formatted representation of the value data.
+ :vartype value_data: str
+ :ivar value_name: The registry value name.
+ :vartype value_name: str
+ :ivar value_type: Specifies the data types to use when storing values in the registry, or
+ identifies the data type of a value in the registry. Known values are: "None", "Unknown",
+ "String", "ExpandString", "Binary", "DWord", "MultiString", and "QWord".
+ :vartype value_type: str or ~azure.mgmt.securityinsight.models.RegistryValueKind
"""
_validation = {
- "condition_type": {"required": True},
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
+ "key_entity_id": {"readonly": True},
+ "value_data": {"readonly": True},
+ "value_name": {"readonly": True},
+ "value_type": {"readonly": True},
}
_attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesCondition"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "key_entity_id": {"key": "keyEntityId", "type": "str"},
+ "value_data": {"key": "valueData", "type": "str"},
+ "value_name": {"key": "valueName", "type": "str"},
+ "value_type": {"key": "valueType", "type": "str"},
}
- def __init__(
- self, *, condition_properties: Optional["_models.AutomationRulePropertyValuesCondition"] = None, **kwargs
- ):
- """
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesCondition
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.condition_type: str = "Property"
- self.condition_properties = condition_properties
+ self.key_entity_id = None
+ self.value_data = None
+ self.value_name = None
+ self.value_type = None
-class Recommendation(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Recommendation object.
+class Relation(ResourceWithEtag):
+ """Represents a relation between two resources.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: id of recommendation. Required.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
- :ivar instructions: Instructions of the recommendation. Required.
- :vartype instructions: ~azure.mgmt.securityinsight.models.Instructions
- :ivar content: Content of the recommendation.
- :vartype content: ~azure.mgmt.securityinsight.models.Content
- :ivar resource_id: Id of the resource this recommendation refers to.
- :vartype resource_id: str
- :ivar additional_properties: Collection of additional properties for the recommendation.
- :vartype additional_properties: dict[str, str]
- :ivar title: Title of the recommendation. Required.
- :vartype title: str
- :ivar description: Description of the recommendation. Required.
- :vartype description: str
- :ivar recommendation_type_title: Title of the recommendation type. Required.
- :vartype recommendation_type_title: str
- :ivar recommendation_type_id: Id of the recommendation type. Required.
- :vartype recommendation_type_id: str
- :ivar category: Category of the recommendation. Required. Known values are: "Onboarding",
- "NewFeature", "SocEfficiency", "CostOptimization", and "Demo".
- :vartype category: str or ~azure.mgmt.securityinsight.models.Category
- :ivar context: Context of the recommendation. Required. Known values are: "Analytics",
- "Incidents", "Overview", and "None".
- :vartype context: str or ~azure.mgmt.securityinsight.models.Context
- :ivar workspace_id: Id of the workspace this recommendation refers to. Required.
- :vartype workspace_id: str
- :ivar actions: List of actions to take for this recommendation. Required.
- :vartype actions: list[~azure.mgmt.securityinsight.models.RecommendedAction]
- :ivar state: State of the recommendation. Required. Known values are: "Active", "Disabled",
- "CompletedByUser", "CompletedByAction", and "Hidden".
- :vartype state: str or ~azure.mgmt.securityinsight.models.State
- :ivar priority: Priority of the recommendation. Required. Known values are: "Low", "Medium",
- and "High".
- :vartype priority: str or ~azure.mgmt.securityinsight.models.Priority
- :ivar last_evaluated_time_utc: The time stamp (UTC) when the recommendation was last evaluated.
- Required.
- :vartype last_evaluated_time_utc: ~datetime.datetime
- :ivar hide_until_time_utc: The time stamp (UTC) when the recommendation should be displayed
- again.
- :vartype hide_until_time_utc: ~datetime.datetime
- :ivar display_until_time_utc: The timestamp (UTC) after which the recommendation should not be
- displayed anymore.
- :vartype display_until_time_utc: ~datetime.datetime
- :ivar visible: Value indicating if the recommendation should be displayed or not.
- :vartype visible: bool
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar related_resource_id: The resource ID of the related resource.
+ :vartype related_resource_id: str
+ :ivar related_resource_name: The name of the related resource.
+ :vartype related_resource_name: str
+ :ivar related_resource_type: The resource type of the related resource.
+ :vartype related_resource_type: str
+ :ivar related_resource_kind: The resource kind of the related resource.
+ :vartype related_resource_kind: str
"""
_validation = {
- "id": {"required": True},
- "instructions": {"required": True},
- "title": {"required": True},
- "description": {"required": True},
- "recommendation_type_title": {"required": True},
- "recommendation_type_id": {"required": True},
- "category": {"required": True},
- "context": {"required": True},
- "workspace_id": {"required": True},
- "actions": {"required": True},
- "state": {"required": True},
- "priority": {"required": True},
- "last_evaluated_time_utc": {"required": True},
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "related_resource_name": {"readonly": True},
+ "related_resource_type": {"readonly": True},
+ "related_resource_kind": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
- "instructions": {"key": "instructions", "type": "Instructions"},
- "content": {"key": "content", "type": "Content"},
- "resource_id": {"key": "resourceId", "type": "str"},
- "additional_properties": {"key": "additionalProperties", "type": "{str}"},
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "recommendation_type_title": {"key": "recommendationTypeTitle", "type": "str"},
- "recommendation_type_id": {"key": "recommendationTypeId", "type": "str"},
- "category": {"key": "category", "type": "str"},
- "context": {"key": "context", "type": "str"},
- "workspace_id": {"key": "workspaceId", "type": "str"},
- "actions": {"key": "actions", "type": "[RecommendedAction]"},
- "state": {"key": "state", "type": "str"},
- "priority": {"key": "priority", "type": "str"},
- "last_evaluated_time_utc": {"key": "lastEvaluatedTimeUtc", "type": "iso-8601"},
- "hide_until_time_utc": {"key": "hideUntilTimeUtc", "type": "iso-8601"},
- "display_until_time_utc": {"key": "displayUntilTimeUtc", "type": "iso-8601"},
- "visible": {"key": "visible", "type": "bool"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "related_resource_id": {"key": "properties.relatedResourceId", "type": "str"},
+ "related_resource_name": {"key": "properties.relatedResourceName", "type": "str"},
+ "related_resource_type": {"key": "properties.relatedResourceType", "type": "str"},
+ "related_resource_kind": {"key": "properties.relatedResourceKind", "type": "str"},
}
- def __init__(
- self,
- *,
- id: str, # pylint: disable=redefined-builtin
- instructions: "_models.Instructions",
- title: str,
- description: str,
- recommendation_type_title: str,
- recommendation_type_id: str,
- category: Union[str, "_models.Category"],
- context: Union[str, "_models.Context"],
- workspace_id: str,
- actions: List["_models.RecommendedAction"],
- state: Union[str, "_models.State"],
- priority: Union[str, "_models.Priority"],
- last_evaluated_time_utc: datetime.datetime,
- content: Optional["_models.Content"] = None,
- resource_id: Optional[str] = None,
- additional_properties: Optional[Dict[str, str]] = None,
- hide_until_time_utc: Optional[datetime.datetime] = None,
- display_until_time_utc: Optional[datetime.datetime] = None,
- visible: Optional[bool] = None,
- **kwargs
- ):
- """
- :keyword id: id of recommendation. Required.
- :paramtype id: str
- :keyword instructions: Instructions of the recommendation. Required.
- :paramtype instructions: ~azure.mgmt.securityinsight.models.Instructions
- :keyword content: Content of the recommendation.
- :paramtype content: ~azure.mgmt.securityinsight.models.Content
- :keyword resource_id: Id of the resource this recommendation refers to.
- :paramtype resource_id: str
- :keyword additional_properties: Collection of additional properties for the recommendation.
- :paramtype additional_properties: dict[str, str]
- :keyword title: Title of the recommendation. Required.
- :paramtype title: str
- :keyword description: Description of the recommendation. Required.
- :paramtype description: str
- :keyword recommendation_type_title: Title of the recommendation type. Required.
- :paramtype recommendation_type_title: str
- :keyword recommendation_type_id: Id of the recommendation type. Required.
- :paramtype recommendation_type_id: str
- :keyword category: Category of the recommendation. Required. Known values are: "Onboarding",
- "NewFeature", "SocEfficiency", "CostOptimization", and "Demo".
- :paramtype category: str or ~azure.mgmt.securityinsight.models.Category
- :keyword context: Context of the recommendation. Required. Known values are: "Analytics",
- "Incidents", "Overview", and "None".
- :paramtype context: str or ~azure.mgmt.securityinsight.models.Context
- :keyword workspace_id: Id of the workspace this recommendation refers to. Required.
- :paramtype workspace_id: str
- :keyword actions: List of actions to take for this recommendation. Required.
- :paramtype actions: list[~azure.mgmt.securityinsight.models.RecommendedAction]
- :keyword state: State of the recommendation. Required. Known values are: "Active", "Disabled",
- "CompletedByUser", "CompletedByAction", and "Hidden".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.State
- :keyword priority: Priority of the recommendation. Required. Known values are: "Low", "Medium",
- and "High".
- :paramtype priority: str or ~azure.mgmt.securityinsight.models.Priority
- :keyword last_evaluated_time_utc: The time stamp (UTC) when the recommendation was last
- evaluated. Required.
- :paramtype last_evaluated_time_utc: ~datetime.datetime
- :keyword hide_until_time_utc: The time stamp (UTC) when the recommendation should be displayed
- again.
- :paramtype hide_until_time_utc: ~datetime.datetime
- :keyword display_until_time_utc: The timestamp (UTC) after which the recommendation should not
- be displayed anymore.
- :paramtype display_until_time_utc: ~datetime.datetime
- :keyword visible: Value indicating if the recommendation should be displayed or not.
- :paramtype visible: bool
+ def __init__(self, *, etag: Optional[str] = None, related_resource_id: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword related_resource_id: The resource ID of the related resource.
+ :paramtype related_resource_id: str
"""
- super().__init__(**kwargs)
- self.id = id
- self.instructions = instructions
- self.content = content
- self.resource_id = resource_id
- self.additional_properties = additional_properties
- self.title = title
- self.description = description
- self.recommendation_type_title = recommendation_type_title
- self.recommendation_type_id = recommendation_type_id
- self.category = category
- self.context = context
- self.workspace_id = workspace_id
- self.actions = actions
- self.state = state
- self.priority = priority
- self.last_evaluated_time_utc = last_evaluated_time_utc
- self.hide_until_time_utc = hide_until_time_utc
- self.display_until_time_utc = display_until_time_utc
- self.visible = visible
+ super().__init__(etag=etag, **kwargs)
+ self.related_resource_id = related_resource_id
+ self.related_resource_name = None
+ self.related_resource_type = None
+ self.related_resource_kind = None
+
+class RelationList(_serialization.Model):
+ """List of relations.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
-class RecommendationList(_serialization.Model):
- """A list of recommendations.
+ All required parameters must be populated in order to send to server.
- :ivar value: An list of recommendations.
- :vartype value: list[~azure.mgmt.securityinsight.models.Recommendation]
+ :ivar next_link: URL to fetch the next set of relations.
+ :vartype next_link: str
+ :ivar value: Array of relations. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Relation]
"""
+ _validation = {
+ "next_link": {"readonly": True},
+ "value": {"required": True},
+ }
+
_attribute_map = {
- "value": {"key": "value", "type": "[Recommendation]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Relation]"},
}
- def __init__(self, *, value: Optional[List["_models.Recommendation"]] = None, **kwargs):
+ def __init__(self, *, value: List["_models.Relation"], **kwargs: Any) -> None:
"""
- :keyword value: An list of recommendations.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Recommendation]
+ :keyword value: Array of relations. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Relation]
"""
super().__init__(**kwargs)
+ self.next_link = None
self.value = value
-class RecommendationPatch(_serialization.Model):
- """Recommendation Fields to update.
+class Repo(_serialization.Model):
+ """Represents a repository.
- :ivar state: State of the recommendation. Known values are: "Active", "Disabled",
- "CompletedByUser", "CompletedByAction", and "Hidden".
- :vartype state: str or ~azure.mgmt.securityinsight.models.State
- :ivar hide_until_time_utc: The time stamp (UTC) when the recommendation should be displayed
- again.
- :vartype hide_until_time_utc: ~datetime.datetime
+ :ivar url: The url to access the repository.
+ :vartype url: str
+ :ivar full_name: The name of the repository.
+ :vartype full_name: str
+ :ivar installation_id: The installation id of the repository.
+ :vartype installation_id: int
+ :ivar branches: Array of branches.
+ :vartype branches: list[str]
"""
_attribute_map = {
- "state": {"key": "state", "type": "str"},
- "hide_until_time_utc": {"key": "hideUntilTimeUtc", "type": "iso-8601"},
+ "url": {"key": "url", "type": "str"},
+ "full_name": {"key": "fullName", "type": "str"},
+ "installation_id": {"key": "installationId", "type": "int"},
+ "branches": {"key": "branches", "type": "[str]"},
}
def __init__(
self,
*,
- state: Optional[Union[str, "_models.State"]] = None,
- hide_until_time_utc: Optional[datetime.datetime] = None,
- **kwargs
- ):
- """
- :keyword state: State of the recommendation. Known values are: "Active", "Disabled",
- "CompletedByUser", "CompletedByAction", and "Hidden".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.State
- :keyword hide_until_time_utc: The time stamp (UTC) when the recommendation should be displayed
- again.
- :paramtype hide_until_time_utc: ~datetime.datetime
+ url: Optional[str] = None,
+ full_name: Optional[str] = None,
+ installation_id: Optional[int] = None,
+ branches: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword url: The url to access the repository.
+ :paramtype url: str
+ :keyword full_name: The name of the repository.
+ :paramtype full_name: str
+ :keyword installation_id: The installation id of the repository.
+ :paramtype installation_id: int
+ :keyword branches: Array of branches.
+ :paramtype branches: list[str]
"""
super().__init__(**kwargs)
- self.state = state
- self.hide_until_time_utc = hide_until_time_utc
+ self.url = url
+ self.full_name = full_name
+ self.installation_id = installation_id
+ self.branches = branches
+
+class RepoList(_serialization.Model):
+ """List all the source controls.
-class RecommendedAction(_serialization.Model):
- """What actions should be taken to complete the recommendation.
+ 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.
+ All required parameters must be populated in order to send to server.
- :ivar link_text: Text of the link to complete the action. Required.
- :vartype link_text: str
- :ivar link_url: The Link to complete the action. Required.
- :vartype link_url: str
- :ivar state: The state of the action. Known values are: "Low", "Medium", and "High".
- :vartype state: str or ~azure.mgmt.securityinsight.models.Priority
+ :ivar next_link: URL to fetch the next set of repositories.
+ :vartype next_link: str
+ :ivar value: Array of repositories. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Repo]
"""
_validation = {
- "link_text": {"required": True},
- "link_url": {"required": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "link_text": {"key": "linkText", "type": "str"},
- "link_url": {"key": "linkUrl", "type": "str"},
- "state": {"key": "state", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Repo]"},
}
- def __init__(
- self, *, link_text: str, link_url: str, state: Optional[Union[str, "_models.Priority"]] = None, **kwargs
- ):
+ def __init__(self, *, value: List["_models.Repo"], **kwargs: Any) -> None:
"""
- :keyword link_text: Text of the link to complete the action. Required.
- :paramtype link_text: str
- :keyword link_url: The Link to complete the action. Required.
- :paramtype link_url: str
- :keyword state: The state of the action. Known values are: "Low", "Medium", and "High".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.Priority
+ :keyword value: Array of repositories. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Repo]
"""
super().__init__(**kwargs)
- self.link_text = link_text
- self.link_url = link_url
- self.state = state
+ self.next_link = None
+ self.value = value
-class RegistryKeyEntity(Entity):
- """Represents a registry key entity.
+class Repository(_serialization.Model):
+ """metadata of a repository.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar hive: the hive that holds the registry key. Known values are: "HKEY_LOCAL_MACHINE",
- "HKEY_CLASSES_ROOT", "HKEY_CURRENT_CONFIG", "HKEY_USERS", "HKEY_CURRENT_USER_LOCAL_SETTINGS",
- "HKEY_PERFORMANCE_DATA", "HKEY_PERFORMANCE_NLSTEXT", "HKEY_PERFORMANCE_TEXT", "HKEY_A", and
- "HKEY_CURRENT_USER".
- :vartype hive: str or ~azure.mgmt.securityinsight.models.RegistryHive
- :ivar key: The registry key path.
- :vartype key: str
+ :ivar url: Url of repository. Required.
+ :vartype url: str
+ :ivar branch: Branch name of repository. Required.
+ :vartype branch: str
+ :ivar display_url: Display url of repository.
+ :vartype display_url: str
+ :ivar deployment_logs_url: Url to access repository action logs.
+ :vartype deployment_logs_url: str
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "hive": {"readonly": True},
- "key": {"readonly": True},
+ "url": {"required": True},
+ "branch": {"required": True},
+ "deployment_logs_url": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "hive": {"key": "properties.hive", "type": "str"},
- "key": {"key": "properties.key", "type": "str"},
+ "url": {"key": "url", "type": "str"},
+ "branch": {"key": "branch", "type": "str"},
+ "display_url": {"key": "displayUrl", "type": "str"},
+ "deployment_logs_url": {"key": "deploymentLogsUrl", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, url: str, branch: str, display_url: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword url: Url of repository. Required.
+ :paramtype url: str
+ :keyword branch: Branch name of repository. Required.
+ :paramtype branch: str
+ :keyword display_url: Display url of repository.
+ :paramtype display_url: str
+ """
super().__init__(**kwargs)
- self.kind: str = "RegistryKey"
- self.additional_data = None
- self.friendly_name = None
- self.hive = None
- self.key = None
+ self.url = url
+ self.branch = branch
+ self.display_url = display_url
+ self.deployment_logs_url = None
-class RegistryKeyEntityProperties(EntityCommonProperties):
- """RegistryKey entity property bag.
+class RepositoryAccess(_serialization.Model):
+ """Credentials to access repository.
- 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 server.
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar hive: the hive that holds the registry key. Known values are: "HKEY_LOCAL_MACHINE",
- "HKEY_CLASSES_ROOT", "HKEY_CURRENT_CONFIG", "HKEY_USERS", "HKEY_CURRENT_USER_LOCAL_SETTINGS",
- "HKEY_PERFORMANCE_DATA", "HKEY_PERFORMANCE_NLSTEXT", "HKEY_PERFORMANCE_TEXT", "HKEY_A", and
- "HKEY_CURRENT_USER".
- :vartype hive: str or ~azure.mgmt.securityinsight.models.RegistryHive
- :ivar key: The registry key path.
- :vartype key: str
+ :ivar kind: The kind of repository access credentials. Required. Known values are: "OAuth",
+ "PAT", and "App".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.RepositoryAccessKind
+ :ivar code: OAuth Code. Required when ``kind`` is ``OAuth``.
+ :vartype code: str
+ :ivar state: OAuth State. Required when ``kind`` is ``OAuth``.
+ :vartype state: str
+ :ivar client_id: OAuth ClientId. Required when ``kind`` is ``OAuth``.
+ :vartype client_id: str
+ :ivar token: Personal Access Token. Required when ``kind`` is ``PAT``.
+ :vartype token: str
+ :ivar installation_id: Application installation ID. Required when ``kind`` is ``App``.
+ Supported by ``GitHub`` only.
+ :vartype installation_id: str
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "hive": {"readonly": True},
- "key": {"readonly": True},
+ "kind": {"required": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "hive": {"key": "hive", "type": "str"},
- "key": {"key": "key", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "code": {"key": "code", "type": "str"},
+ "state": {"key": "state", "type": "str"},
+ "client_id": {"key": "clientId", "type": "str"},
+ "token": {"key": "token", "type": "str"},
+ "installation_id": {"key": "installationId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ kind: Union[str, "_models.RepositoryAccessKind"],
+ code: Optional[str] = None,
+ state: Optional[str] = None,
+ client_id: Optional[str] = None,
+ token: Optional[str] = None,
+ installation_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword kind: The kind of repository access credentials. Required. Known values are: "OAuth",
+ "PAT", and "App".
+ :paramtype kind: str or ~azure.mgmt.securityinsight.models.RepositoryAccessKind
+ :keyword code: OAuth Code. Required when ``kind`` is ``OAuth``.
+ :paramtype code: str
+ :keyword state: OAuth State. Required when ``kind`` is ``OAuth``.
+ :paramtype state: str
+ :keyword client_id: OAuth ClientId. Required when ``kind`` is ``OAuth``.
+ :paramtype client_id: str
+ :keyword token: Personal Access Token. Required when ``kind`` is ``PAT``.
+ :paramtype token: str
+ :keyword installation_id: Application installation ID. Required when ``kind`` is ``App``.
+ Supported by ``GitHub`` only.
+ :paramtype installation_id: str
+ """
super().__init__(**kwargs)
- self.hive = None
- self.key = None
-
+ self.kind = kind
+ self.code = code
+ self.state = state
+ self.client_id = client_id
+ self.token = token
+ self.installation_id = installation_id
-class RegistryValueEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a registry value entity.
- Variables are only populated by the server, and will be ignored when sending a request.
+class RepositoryAccessProperties(_serialization.Model):
+ """Credentials to access repository.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
- "AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
- "RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar key_entity_id: The registry key entity id.
- :vartype key_entity_id: str
- :ivar value_data: String formatted representation of the value data.
- :vartype value_data: str
- :ivar value_name: The registry value name.
- :vartype value_name: str
- :ivar value_type: Specifies the data types to use when storing values in the registry, or
- identifies the data type of a value in the registry. Known values are: "None", "Unknown",
- "String", "ExpandString", "Binary", "DWord", "MultiString", and "QWord".
- :vartype value_type: str or ~azure.mgmt.securityinsight.models.RegistryValueKind
+ :ivar kind: The kind of repository access credentials. Required. Known values are: "OAuth",
+ "PAT", and "App".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.RepositoryAccessKind
+ :ivar code: OAuth Code. Required when ``kind`` is ``OAuth``.
+ :vartype code: str
+ :ivar state: OAuth State. Required when ``kind`` is ``OAuth``.
+ :vartype state: str
+ :ivar client_id: OAuth ClientId. Required when ``kind`` is ``OAuth``.
+ :vartype client_id: str
+ :ivar token: Personal Access Token. Required when ``kind`` is ``PAT``.
+ :vartype token: str
+ :ivar installation_id: Application installation ID. Required when ``kind`` is ``App``.
+ Supported by ``GitHub`` only.
+ :vartype installation_id: str
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
"kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "key_entity_id": {"readonly": True},
- "value_data": {"readonly": True},
- "value_name": {"readonly": True},
- "value_type": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "key_entity_id": {"key": "properties.keyEntityId", "type": "str"},
- "value_data": {"key": "properties.valueData", "type": "str"},
- "value_name": {"key": "properties.valueName", "type": "str"},
- "value_type": {"key": "properties.valueType", "type": "str"},
+ "kind": {"key": "properties.repositoryAccess.kind", "type": "str"},
+ "code": {"key": "properties.repositoryAccess.code", "type": "str"},
+ "state": {"key": "properties.repositoryAccess.state", "type": "str"},
+ "client_id": {"key": "properties.repositoryAccess.clientId", "type": "str"},
+ "token": {"key": "properties.repositoryAccess.token", "type": "str"},
+ "installation_id": {"key": "properties.repositoryAccess.installationId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ kind: Union[str, "_models.RepositoryAccessKind"],
+ code: Optional[str] = None,
+ state: Optional[str] = None,
+ client_id: Optional[str] = None,
+ token: Optional[str] = None,
+ installation_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword kind: The kind of repository access credentials. Required. Known values are: "OAuth",
+ "PAT", and "App".
+ :paramtype kind: str or ~azure.mgmt.securityinsight.models.RepositoryAccessKind
+ :keyword code: OAuth Code. Required when ``kind`` is ``OAuth``.
+ :paramtype code: str
+ :keyword state: OAuth State. Required when ``kind`` is ``OAuth``.
+ :paramtype state: str
+ :keyword client_id: OAuth ClientId. Required when ``kind`` is ``OAuth``.
+ :paramtype client_id: str
+ :keyword token: Personal Access Token. Required when ``kind`` is ``PAT``.
+ :paramtype token: str
+ :keyword installation_id: Application installation ID. Required when ``kind`` is ``App``.
+ Supported by ``GitHub`` only.
+ :paramtype installation_id: str
+ """
super().__init__(**kwargs)
- self.kind: str = "RegistryValue"
- self.additional_data = None
- self.friendly_name = None
- self.key_entity_id = None
- self.value_data = None
- self.value_name = None
- self.value_type = None
+ self.kind = kind
+ self.code = code
+ self.state = state
+ self.client_id = client_id
+ self.token = token
+ self.installation_id = installation_id
-class RegistryValueEntityProperties(EntityCommonProperties):
- """RegistryValue entity property bag.
+class RepositoryResourceInfo(_serialization.Model):
+ """Resources created in user's repository for the source-control.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar key_entity_id: The registry key entity id.
- :vartype key_entity_id: str
- :ivar value_data: String formatted representation of the value data.
- :vartype value_data: str
- :ivar value_name: The registry value name.
- :vartype value_name: str
- :ivar value_type: Specifies the data types to use when storing values in the registry, or
- identifies the data type of a value in the registry. Known values are: "None", "Unknown",
- "String", "ExpandString", "Binary", "DWord", "MultiString", and "QWord".
- :vartype value_type: str or ~azure.mgmt.securityinsight.models.RegistryValueKind
+ :ivar webhook: The webhook object created for the source-control.
+ :vartype webhook: ~azure.mgmt.securityinsight.models.Webhook
+ :ivar git_hub_resource_info: Resources created in GitHub for this source-control.
+ :vartype git_hub_resource_info: ~azure.mgmt.securityinsight.models.GitHubResourceInfo
+ :ivar azure_dev_ops_resource_info: Resources created in Azure DevOps for this source-control.
+ :vartype azure_dev_ops_resource_info:
+ ~azure.mgmt.securityinsight.models.AzureDevOpsResourceInfo
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "key_entity_id": {"readonly": True},
- "value_data": {"readonly": True},
- "value_name": {"readonly": True},
- "value_type": {"readonly": True},
+ "git_hub_resource_info": {"readonly": True},
+ "azure_dev_ops_resource_info": {"readonly": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "key_entity_id": {"key": "keyEntityId", "type": "str"},
- "value_data": {"key": "valueData", "type": "str"},
- "value_name": {"key": "valueName", "type": "str"},
- "value_type": {"key": "valueType", "type": "str"},
+ "webhook": {"key": "webhook", "type": "Webhook"},
+ "git_hub_resource_info": {"key": "gitHubResourceInfo", "type": "GitHubResourceInfo"},
+ "azure_dev_ops_resource_info": {"key": "azureDevOpsResourceInfo", "type": "AzureDevOpsResourceInfo"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, webhook: Optional["_models.Webhook"] = None, **kwargs: Any) -> None:
+ """
+ :keyword webhook: The webhook object created for the source-control.
+ :paramtype webhook: ~azure.mgmt.securityinsight.models.Webhook
+ """
super().__init__(**kwargs)
- self.key_entity_id = None
- self.value_data = None
- self.value_name = None
- self.value_type = None
+ self.webhook = webhook
+ self.git_hub_resource_info = None
+ self.azure_dev_ops_resource_info = None
-class Relation(ResourceWithEtag):
- """Represents a relation between two resources.
+class ResourceProviderRequiredPermissions(_serialization.Model):
+ """Required permissions for the connector resource provider that define in ResourceProviders.
+ For more information about the permissions see :code:`here`.
+
+ :ivar read: Gets or sets a value indicating whether the permission is read action (GET).
+ :vartype read: bool
+ :ivar write: Gets or sets a value indicating whether the permission is write action (PUT or
+ PATCH).
+ :vartype write: bool
+ :ivar delete: Gets or sets a value indicating whether the permission is delete action (DELETE).
+ :vartype delete: bool
+ :ivar action: Gets or sets a value indicating whether the permission is custom actions (POST).
+ :vartype action: bool
+ """
+
+ _attribute_map = {
+ "read": {"key": "read", "type": "bool"},
+ "write": {"key": "write", "type": "bool"},
+ "delete": {"key": "delete", "type": "bool"},
+ "action": {"key": "action", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ read: Optional[bool] = None,
+ write: Optional[bool] = None,
+ delete: Optional[bool] = None,
+ action: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword read: Gets or sets a value indicating whether the permission is read action (GET).
+ :paramtype read: bool
+ :keyword write: Gets or sets a value indicating whether the permission is write action (PUT or
+ PATCH).
+ :paramtype write: bool
+ :keyword delete: Gets or sets a value indicating whether the permission is delete action
+ (DELETE).
+ :paramtype delete: bool
+ :keyword action: Gets or sets a value indicating whether the permission is custom actions
+ (POST).
+ :paramtype action: bool
+ """
+ super().__init__(**kwargs)
+ self.read = read
+ self.write = write
+ self.delete = delete
+ self.action = action
+
+
+class RestApiPollerDataConnector(DataConnector):
+ """Represents Rest Api Poller data connector.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -18578,14 +13129,32 @@ class Relation(ResourceWithEtag):
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar related_resource_id: The resource ID of the related resource.
- :vartype related_resource_id: str
- :ivar related_resource_name: The name of the related resource.
- :vartype related_resource_name: str
- :ivar related_resource_type: The resource type of the related resource.
- :vartype related_resource_type: str
- :ivar related_resource_kind: The resource kind of the related resource.
- :vartype related_resource_kind: str
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
+ :ivar connector_definition_name: The connector definition name (the dataConnectorDefinition
+ resource id).
+ :vartype connector_definition_name: str
+ :ivar auth: The a authentication model.
+ :vartype auth: ~azure.mgmt.securityinsight.models.CcpAuthConfig
+ :ivar request: The request configuration.
+ :vartype request: ~azure.mgmt.securityinsight.models.RestApiPollerRequestConfig
+ :ivar dcr_config: The DCR related properties.
+ :vartype dcr_config: ~azure.mgmt.securityinsight.models.DCRConfiguration
+ :ivar is_active: Indicates whether the connector is active or not.
+ :vartype is_active: bool
+ :ivar data_type: The Log Analytics table destination.
+ :vartype data_type: str
+ :ivar response: The response configuration.
+ :vartype response: ~azure.mgmt.securityinsight.models.CcpResponseConfig
+ :ivar paging: The paging configuration.
+ :vartype paging: ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingConfig
+ :ivar add_on_attributes: The add on attributes. The key name will become attribute name (a
+ column) and the value will become the attribute value in the payload.
+ :vartype add_on_attributes: dict[str, str]
"""
_validation = {
@@ -18593,9 +13162,7 @@ class Relation(ResourceWithEtag):
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "related_resource_name": {"readonly": True},
- "related_resource_type": {"readonly": True},
- "related_resource_kind": {"readonly": True},
+ "kind": {"required": True},
}
_attribute_map = {
@@ -18604,281 +13171,667 @@ class Relation(ResourceWithEtag):
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "related_resource_id": {"key": "properties.relatedResourceId", "type": "str"},
- "related_resource_name": {"key": "properties.relatedResourceName", "type": "str"},
- "related_resource_type": {"key": "properties.relatedResourceType", "type": "str"},
- "related_resource_kind": {"key": "properties.relatedResourceKind", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "connector_definition_name": {"key": "properties.connectorDefinitionName", "type": "str"},
+ "auth": {"key": "properties.auth", "type": "CcpAuthConfig"},
+ "request": {"key": "properties.request", "type": "RestApiPollerRequestConfig"},
+ "dcr_config": {"key": "properties.dcrConfig", "type": "DCRConfiguration"},
+ "is_active": {"key": "properties.isActive", "type": "bool"},
+ "data_type": {"key": "properties.dataType", "type": "str"},
+ "response": {"key": "properties.response", "type": "CcpResponseConfig"},
+ "paging": {"key": "properties.paging", "type": "RestApiPollerRequestPagingConfig"},
+ "add_on_attributes": {"key": "properties.addOnAttributes", "type": "{str}"},
}
- def __init__(self, *, etag: Optional[str] = None, related_resource_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ connector_definition_name: Optional[str] = None,
+ auth: Optional["_models.CcpAuthConfig"] = None,
+ request: Optional["_models.RestApiPollerRequestConfig"] = None,
+ dcr_config: Optional["_models.DCRConfiguration"] = None,
+ is_active: Optional[bool] = None,
+ data_type: Optional[str] = None,
+ response: Optional["_models.CcpResponseConfig"] = None,
+ paging: Optional["_models.RestApiPollerRequestPagingConfig"] = None,
+ add_on_attributes: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword related_resource_id: The resource ID of the related resource.
- :paramtype related_resource_id: str
+ :keyword connector_definition_name: The connector definition name (the dataConnectorDefinition
+ resource id).
+ :paramtype connector_definition_name: str
+ :keyword auth: The a authentication model.
+ :paramtype auth: ~azure.mgmt.securityinsight.models.CcpAuthConfig
+ :keyword request: The request configuration.
+ :paramtype request: ~azure.mgmt.securityinsight.models.RestApiPollerRequestConfig
+ :keyword dcr_config: The DCR related properties.
+ :paramtype dcr_config: ~azure.mgmt.securityinsight.models.DCRConfiguration
+ :keyword is_active: Indicates whether the connector is active or not.
+ :paramtype is_active: bool
+ :keyword data_type: The Log Analytics table destination.
+ :paramtype data_type: str
+ :keyword response: The response configuration.
+ :paramtype response: ~azure.mgmt.securityinsight.models.CcpResponseConfig
+ :keyword paging: The paging configuration.
+ :paramtype paging: ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingConfig
+ :keyword add_on_attributes: The add on attributes. The key name will become attribute name (a
+ column) and the value will become the attribute value in the payload.
+ :paramtype add_on_attributes: dict[str, str]
"""
super().__init__(etag=etag, **kwargs)
- self.related_resource_id = related_resource_id
- self.related_resource_name = None
- self.related_resource_type = None
- self.related_resource_kind = None
-
+ self.kind: str = "RestApiPoller"
+ self.connector_definition_name = connector_definition_name
+ self.auth = auth
+ self.request = request
+ self.dcr_config = dcr_config
+ self.is_active = is_active
+ self.data_type = data_type
+ self.response = response
+ self.paging = paging
+ self.add_on_attributes = add_on_attributes
-class RelationList(_serialization.Model):
- """List of relations.
- Variables are only populated by the server, and will be ignored when sending a request.
+class RestApiPollerRequestConfig(_serialization.Model):
+ """The request configuration.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar next_link: URL to fetch the next set of relations.
- :vartype next_link: str
- :ivar value: Array of relations. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Relation]
+ :ivar api_endpoint: The API endpoint. Required.
+ :vartype api_endpoint: str
+ :ivar rate_limit_qps: The Rate limit queries per second for the request..
+ :vartype rate_limit_qps: int
+ :ivar query_window_in_min: The query window in minutes for the request.
+ :vartype query_window_in_min: int
+ :ivar http_method: The HTTP method, default value GET. Known values are: "GET", "POST", "PUT",
+ and "DELETE".
+ :vartype http_method: str or ~azure.mgmt.securityinsight.models.HttpMethodVerb
+ :ivar query_time_format: The query time format. A remote server can have a query to pull data
+ from range 'start' to 'end'. This property indicate what is the expected time format the remote
+ server know to parse.
+ :vartype query_time_format: str
+ :ivar retry_count: The retry count.
+ :vartype retry_count: int
+ :ivar timeout_in_seconds: The timeout in seconds.
+ :vartype timeout_in_seconds: int
+ :ivar is_post_payload_json: Flag to indicate if HTTP POST payload is in JSON format (vs
+ form-urlencoded).
+ :vartype is_post_payload_json: bool
+ :ivar headers: The header for the request for the remote server.
+ :vartype headers: dict[str, str]
+ :ivar query_parameters: The HTTP query parameters to RESTful API.
+ :vartype query_parameters: dict[str, any]
+ :ivar query_parameters_template: the query parameters template. Defines the query parameters
+ template to use when passing query parameters in advanced scenarios.
+ :vartype query_parameters_template: str
+ :ivar start_time_attribute_name: The query parameter name which the remote server expect to
+ start query. This property goes hand to hand with ``endTimeAttributeName``.
+ :vartype start_time_attribute_name: str
+ :ivar end_time_attribute_name: The query parameter name which the remote server expect to end
+ query. This property goes hand to hand with ``startTimeAttributeName``.
+ :vartype end_time_attribute_name: str
+ :ivar query_time_interval_attribute_name: The query parameter name which we need to send the
+ server for query logs in time interval. Should be defined with ``queryTimeIntervalPrepend`` and
+ ``queryTimeIntervalDelimiter``.
+ :vartype query_time_interval_attribute_name: str
+ :ivar query_time_interval_prepend: The string prepend to the value of the query parameter in
+ ``queryTimeIntervalAttributeName``.
+ :vartype query_time_interval_prepend: str
+ :ivar query_time_interval_delimiter: The delimiter string between 2 QueryTimeFormat in the
+ query parameter ``queryTimeIntervalAttributeName``.
+ :vartype query_time_interval_delimiter: str
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ "api_endpoint": {"required": True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Relation]"},
+ "api_endpoint": {"key": "apiEndpoint", "type": "str"},
+ "rate_limit_qps": {"key": "rateLimitQPS", "type": "int"},
+ "query_window_in_min": {"key": "queryWindowInMin", "type": "int"},
+ "http_method": {"key": "httpMethod", "type": "str"},
+ "query_time_format": {"key": "queryTimeFormat", "type": "str"},
+ "retry_count": {"key": "retryCount", "type": "int"},
+ "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"},
+ "is_post_payload_json": {"key": "isPostPayloadJson", "type": "bool"},
+ "headers": {"key": "headers", "type": "{str}"},
+ "query_parameters": {"key": "queryParameters", "type": "{object}"},
+ "query_parameters_template": {"key": "queryParametersTemplate", "type": "str"},
+ "start_time_attribute_name": {"key": "startTimeAttributeName", "type": "str"},
+ "end_time_attribute_name": {"key": "endTimeAttributeName", "type": "str"},
+ "query_time_interval_attribute_name": {"key": "queryTimeIntervalAttributeName", "type": "str"},
+ "query_time_interval_prepend": {"key": "queryTimeIntervalPrepend", "type": "str"},
+ "query_time_interval_delimiter": {"key": "queryTimeIntervalDelimiter", "type": "str"},
}
- def __init__(self, *, value: List["_models.Relation"], **kwargs):
+ def __init__(
+ self,
+ *,
+ api_endpoint: str,
+ rate_limit_qps: Optional[int] = None,
+ query_window_in_min: Optional[int] = None,
+ http_method: Optional[Union[str, "_models.HttpMethodVerb"]] = None,
+ query_time_format: Optional[str] = None,
+ retry_count: Optional[int] = None,
+ timeout_in_seconds: Optional[int] = None,
+ is_post_payload_json: Optional[bool] = None,
+ headers: Optional[Dict[str, str]] = None,
+ query_parameters: Optional[Dict[str, Any]] = None,
+ query_parameters_template: Optional[str] = None,
+ start_time_attribute_name: Optional[str] = None,
+ end_time_attribute_name: Optional[str] = None,
+ query_time_interval_attribute_name: Optional[str] = None,
+ query_time_interval_prepend: Optional[str] = None,
+ query_time_interval_delimiter: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of relations. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Relation]
+ :keyword api_endpoint: The API endpoint. Required.
+ :paramtype api_endpoint: str
+ :keyword rate_limit_qps: The Rate limit queries per second for the request..
+ :paramtype rate_limit_qps: int
+ :keyword query_window_in_min: The query window in minutes for the request.
+ :paramtype query_window_in_min: int
+ :keyword http_method: The HTTP method, default value GET. Known values are: "GET", "POST",
+ "PUT", and "DELETE".
+ :paramtype http_method: str or ~azure.mgmt.securityinsight.models.HttpMethodVerb
+ :keyword query_time_format: The query time format. A remote server can have a query to pull
+ data from range 'start' to 'end'. This property indicate what is the expected time format the
+ remote server know to parse.
+ :paramtype query_time_format: str
+ :keyword retry_count: The retry count.
+ :paramtype retry_count: int
+ :keyword timeout_in_seconds: The timeout in seconds.
+ :paramtype timeout_in_seconds: int
+ :keyword is_post_payload_json: Flag to indicate if HTTP POST payload is in JSON format (vs
+ form-urlencoded).
+ :paramtype is_post_payload_json: bool
+ :keyword headers: The header for the request for the remote server.
+ :paramtype headers: dict[str, str]
+ :keyword query_parameters: The HTTP query parameters to RESTful API.
+ :paramtype query_parameters: dict[str, any]
+ :keyword query_parameters_template: the query parameters template. Defines the query parameters
+ template to use when passing query parameters in advanced scenarios.
+ :paramtype query_parameters_template: str
+ :keyword start_time_attribute_name: The query parameter name which the remote server expect to
+ start query. This property goes hand to hand with ``endTimeAttributeName``.
+ :paramtype start_time_attribute_name: str
+ :keyword end_time_attribute_name: The query parameter name which the remote server expect to
+ end query. This property goes hand to hand with ``startTimeAttributeName``.
+ :paramtype end_time_attribute_name: str
+ :keyword query_time_interval_attribute_name: The query parameter name which we need to send the
+ server for query logs in time interval. Should be defined with ``queryTimeIntervalPrepend`` and
+ ``queryTimeIntervalDelimiter``.
+ :paramtype query_time_interval_attribute_name: str
+ :keyword query_time_interval_prepend: The string prepend to the value of the query parameter in
+ ``queryTimeIntervalAttributeName``.
+ :paramtype query_time_interval_prepend: str
+ :keyword query_time_interval_delimiter: The delimiter string between 2 QueryTimeFormat in the
+ query parameter ``queryTimeIntervalAttributeName``.
+ :paramtype query_time_interval_delimiter: str
"""
super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ self.api_endpoint = api_endpoint
+ self.rate_limit_qps = rate_limit_qps
+ self.query_window_in_min = query_window_in_min
+ self.http_method = http_method
+ self.query_time_format = query_time_format
+ self.retry_count = retry_count
+ self.timeout_in_seconds = timeout_in_seconds
+ self.is_post_payload_json = is_post_payload_json
+ self.headers = headers
+ self.query_parameters = query_parameters
+ self.query_parameters_template = query_parameters_template
+ self.start_time_attribute_name = start_time_attribute_name
+ self.end_time_attribute_name = end_time_attribute_name
+ self.query_time_interval_attribute_name = query_time_interval_attribute_name
+ self.query_time_interval_prepend = query_time_interval_prepend
+ self.query_time_interval_delimiter = query_time_interval_delimiter
-class Repo(_serialization.Model):
- """Represents a repository.
+class RestApiPollerRequestPagingConfig(_serialization.Model):
+ """The request paging configuration.
- :ivar url: The url to access the repository.
- :vartype url: str
- :ivar full_name: The name of the repository.
- :vartype full_name: str
- :ivar branches: Array of branches.
- :vartype branches: list[str]
+ All required parameters must be populated in order to send to server.
+
+ :ivar paging_type: Type of paging. Required. Known values are: "LinkHeader", "NextPageToken",
+ "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and "CountBasedPaging".
+ :vartype paging_type: str or ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :ivar page_size: Page size.
+ :vartype page_size: int
+ :ivar page_size_parameter_name: Page size parameter name.
+ :vartype page_size_parameter_name: str
"""
+ _validation = {
+ "paging_type": {"required": True},
+ }
+
_attribute_map = {
- "url": {"key": "url", "type": "str"},
- "full_name": {"key": "fullName", "type": "str"},
- "branches": {"key": "branches", "type": "[str]"},
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ paging_type: Union[str, "_models.RestApiPollerRequestPagingKind"],
+ page_size: Optional[int] = None,
+ page_size_parameter_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword paging_type: Type of paging. Required. Known values are: "LinkHeader",
+ "NextPageToken", "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and
+ "CountBasedPaging".
+ :paramtype paging_type: str or
+ ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :keyword page_size: Page size.
+ :paramtype page_size: int
+ :keyword page_size_parameter_name: Page size parameter name.
+ :paramtype page_size_parameter_name: str
+ """
+ super().__init__(**kwargs)
+ self.paging_type = paging_type
+ self.page_size = page_size
+ self.page_size_parameter_name = page_size_parameter_name
+
+
+class RestApiPollerRequestPagingCountBaseConfig(RestApiPollerRequestPagingConfig): # pylint: disable=name-too-long
+ """The request paging configuration for Count base paging type parameters.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar paging_type: Type of paging. Required. Known values are: "LinkHeader", "NextPageToken",
+ "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and "CountBasedPaging".
+ :vartype paging_type: str or ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :ivar page_size: Page size.
+ :vartype page_size: int
+ :ivar page_size_parameter_name: Page size parameter name.
+ :vartype page_size_parameter_name: str
+ :ivar zero_based_indexing: Indicates whether the count is zero based.
+ :vartype zero_based_indexing: bool
+ :ivar page_count_json_path: JSON path of page count in HTTP response payload.
+ :vartype page_count_json_path: str
+ :ivar page_number_para_name: Parameter name of page number in HTTP request.
+ :vartype page_number_para_name: str
+ :ivar page_number_json_path: JSON path of page number in HTTP response payload.
+ :vartype page_number_json_path: str
+ :ivar total_results_json_path: JSON path of total number of results in HTTP response payload.
+ :vartype total_results_json_path: str
+ """
+
+ _validation = {
+ "paging_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
+ "zero_based_indexing": {"key": "zeroBasedIndexing", "type": "bool"},
+ "page_count_json_path": {"key": "pageCountJsonPath", "type": "str"},
+ "page_number_para_name": {"key": "pageNumberParaName", "type": "str"},
+ "page_number_json_path": {"key": "pageNumberJsonPath", "type": "str"},
+ "total_results_json_path": {"key": "totalResultsJsonPath", "type": "str"},
}
def __init__(
self,
*,
- url: Optional[str] = None,
- full_name: Optional[str] = None,
- branches: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword url: The url to access the repository.
- :paramtype url: str
- :keyword full_name: The name of the repository.
- :paramtype full_name: str
- :keyword branches: Array of branches.
- :paramtype branches: list[str]
+ paging_type: Union[str, "_models.RestApiPollerRequestPagingKind"],
+ page_size: Optional[int] = None,
+ page_size_parameter_name: Optional[str] = None,
+ zero_based_indexing: Optional[bool] = None,
+ page_count_json_path: Optional[str] = None,
+ page_number_para_name: Optional[str] = None,
+ page_number_json_path: Optional[str] = None,
+ total_results_json_path: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword paging_type: Type of paging. Required. Known values are: "LinkHeader",
+ "NextPageToken", "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and
+ "CountBasedPaging".
+ :paramtype paging_type: str or
+ ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :keyword page_size: Page size.
+ :paramtype page_size: int
+ :keyword page_size_parameter_name: Page size parameter name.
+ :paramtype page_size_parameter_name: str
+ :keyword zero_based_indexing: Indicates whether the count is zero based.
+ :paramtype zero_based_indexing: bool
+ :keyword page_count_json_path: JSON path of page count in HTTP response payload.
+ :paramtype page_count_json_path: str
+ :keyword page_number_para_name: Parameter name of page number in HTTP request.
+ :paramtype page_number_para_name: str
+ :keyword page_number_json_path: JSON path of page number in HTTP response payload.
+ :paramtype page_number_json_path: str
+ :keyword total_results_json_path: JSON path of total number of results in HTTP response
+ payload.
+ :paramtype total_results_json_path: str
"""
- super().__init__(**kwargs)
- self.url = url
- self.full_name = full_name
- self.branches = branches
-
+ super().__init__(
+ paging_type=paging_type, page_size=page_size, page_size_parameter_name=page_size_parameter_name, **kwargs
+ )
+ self.zero_based_indexing = zero_based_indexing
+ self.page_count_json_path = page_count_json_path
+ self.page_number_para_name = page_number_para_name
+ self.page_number_json_path = page_number_json_path
+ self.total_results_json_path = total_results_json_path
-class RepoList(_serialization.Model):
- """List all the source controls.
- Variables are only populated by the server, and will be ignored when sending a request.
+class RestApiPollerRequestPagingLinkHeaderConfig(RestApiPollerRequestPagingConfig): # pylint: disable=name-too-long
+ """The request paging configuration for LinkHeader and PersistentLinkHeader paging type
+ parameters.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar next_link: URL to fetch the next set of repositories.
- :vartype next_link: str
- :ivar value: Array of repositories. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Repo]
+ :ivar paging_type: Type of paging. Required. Known values are: "LinkHeader", "NextPageToken",
+ "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and "CountBasedPaging".
+ :vartype paging_type: str or ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :ivar page_size: Page size.
+ :vartype page_size: int
+ :ivar page_size_parameter_name: Page size parameter name.
+ :vartype page_size_parameter_name: str
+ :ivar link_header_token_json_path: JSON path of link header token in HTTP response payload.
+ :vartype link_header_token_json_path: str
+ :ivar link_header_rel_link_name: Rel link name from the link header.
+ :vartype link_header_rel_link_name: str
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ "paging_type": {"required": True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Repo]"},
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
+ "link_header_token_json_path": {"key": "linkHeaderTokenJsonPath", "type": "str"},
+ "link_header_rel_link_name": {"key": "linkHeaderRelLinkName", "type": "str"},
}
- def __init__(self, *, value: List["_models.Repo"], **kwargs):
- """
- :keyword value: Array of repositories. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Repo]
+ def __init__(
+ self,
+ *,
+ paging_type: Union[str, "_models.RestApiPollerRequestPagingKind"],
+ page_size: Optional[int] = None,
+ page_size_parameter_name: Optional[str] = None,
+ link_header_token_json_path: Optional[str] = None,
+ link_header_rel_link_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword paging_type: Type of paging. Required. Known values are: "LinkHeader",
+ "NextPageToken", "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and
+ "CountBasedPaging".
+ :paramtype paging_type: str or
+ ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :keyword page_size: Page size.
+ :paramtype page_size: int
+ :keyword page_size_parameter_name: Page size parameter name.
+ :paramtype page_size_parameter_name: str
+ :keyword link_header_token_json_path: JSON path of link header token in HTTP response payload.
+ :paramtype link_header_token_json_path: str
+ :keyword link_header_rel_link_name: Rel link name from the link header.
+ :paramtype link_header_rel_link_name: str
"""
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ super().__init__(
+ paging_type=paging_type, page_size=page_size, page_size_parameter_name=page_size_parameter_name, **kwargs
+ )
+ self.link_header_token_json_path = link_header_token_json_path
+ self.link_header_rel_link_name = link_header_rel_link_name
-class Repository(_serialization.Model):
- """metadata of a repository.
+class RestApiPollerRequestPagingNextPageUrlConfig(RestApiPollerRequestPagingConfig): # pylint: disable=name-too-long
+ """The request paging configuration for NextPageUrl paging type parameters.
- :ivar url: Url of repository.
- :vartype url: str
- :ivar branch: Branch name of repository.
- :vartype branch: str
- :ivar display_url: Display url of repository.
- :vartype display_url: str
- :ivar deployment_logs_url: Url to access repository action logs.
- :vartype deployment_logs_url: str
- :ivar path_mapping: Dictionary of source control content type and path mapping.
- :vartype path_mapping: list[~azure.mgmt.securityinsight.models.ContentPathMap]
+ All required parameters must be populated in order to send to server.
+
+ :ivar paging_type: Type of paging. Required. Known values are: "LinkHeader", "NextPageToken",
+ "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and "CountBasedPaging".
+ :vartype paging_type: str or ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :ivar page_size: Page size.
+ :vartype page_size: int
+ :ivar page_size_parameter_name: Page size parameter name.
+ :vartype page_size_parameter_name: str
+ :ivar next_page_url: Next page URL.
+ :vartype next_page_url: str
+ :ivar next_page_url_query_parameters: Query parameters of next page URL.
+ :vartype next_page_url_query_parameters: dict[str, str]
+ :ivar next_page_url_query_parameters_template: Paging query parameters in string template
+ format.
+ :vartype next_page_url_query_parameters_template: str
+ :ivar next_page_para_name: Next page parameter name in HTTP request.
+ :vartype next_page_para_name: str
+ :ivar next_page_request_header: Next page header name in the request.
+ :vartype next_page_request_header: str
+ :ivar has_next_flag_json_path: JSON path of flag in HTTP response payload to indicate more
+ pages.
+ :vartype has_next_flag_json_path: str
"""
+ _validation = {
+ "paging_type": {"required": True},
+ }
+
_attribute_map = {
- "url": {"key": "url", "type": "str"},
- "branch": {"key": "branch", "type": "str"},
- "display_url": {"key": "displayUrl", "type": "str"},
- "deployment_logs_url": {"key": "deploymentLogsUrl", "type": "str"},
- "path_mapping": {"key": "pathMapping", "type": "[ContentPathMap]"},
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
+ "next_page_url": {"key": "nextPageUrl", "type": "str"},
+ "next_page_url_query_parameters": {"key": "nextPageUrlQueryParameters", "type": "{str}"},
+ "next_page_url_query_parameters_template": {"key": "nextPageUrlQueryParametersTemplate", "type": "str"},
+ "next_page_para_name": {"key": "nextPageParaName", "type": "str"},
+ "next_page_request_header": {"key": "nextPageRequestHeader", "type": "str"},
+ "has_next_flag_json_path": {"key": "hasNextFlagJsonPath", "type": "str"},
}
def __init__(
self,
*,
- url: Optional[str] = None,
- branch: Optional[str] = None,
- display_url: Optional[str] = None,
- deployment_logs_url: Optional[str] = None,
- path_mapping: Optional[List["_models.ContentPathMap"]] = None,
- **kwargs
- ):
- """
- :keyword url: Url of repository.
- :paramtype url: str
- :keyword branch: Branch name of repository.
- :paramtype branch: str
- :keyword display_url: Display url of repository.
- :paramtype display_url: str
- :keyword deployment_logs_url: Url to access repository action logs.
- :paramtype deployment_logs_url: str
- :keyword path_mapping: Dictionary of source control content type and path mapping.
- :paramtype path_mapping: list[~azure.mgmt.securityinsight.models.ContentPathMap]
+ paging_type: Union[str, "_models.RestApiPollerRequestPagingKind"],
+ page_size: Optional[int] = None,
+ page_size_parameter_name: Optional[str] = None,
+ next_page_url: Optional[str] = None,
+ next_page_url_query_parameters: Optional[Dict[str, str]] = None,
+ next_page_url_query_parameters_template: Optional[str] = None,
+ next_page_para_name: Optional[str] = None,
+ next_page_request_header: Optional[str] = None,
+ has_next_flag_json_path: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword paging_type: Type of paging. Required. Known values are: "LinkHeader",
+ "NextPageToken", "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and
+ "CountBasedPaging".
+ :paramtype paging_type: str or
+ ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :keyword page_size: Page size.
+ :paramtype page_size: int
+ :keyword page_size_parameter_name: Page size parameter name.
+ :paramtype page_size_parameter_name: str
+ :keyword next_page_url: Next page URL.
+ :paramtype next_page_url: str
+ :keyword next_page_url_query_parameters: Query parameters of next page URL.
+ :paramtype next_page_url_query_parameters: dict[str, str]
+ :keyword next_page_url_query_parameters_template: Paging query parameters in string template
+ format.
+ :paramtype next_page_url_query_parameters_template: str
+ :keyword next_page_para_name: Next page parameter name in HTTP request.
+ :paramtype next_page_para_name: str
+ :keyword next_page_request_header: Next page header name in the request.
+ :paramtype next_page_request_header: str
+ :keyword has_next_flag_json_path: JSON path of flag in HTTP response payload to indicate more
+ pages.
+ :paramtype has_next_flag_json_path: str
"""
- super().__init__(**kwargs)
- self.url = url
- self.branch = branch
- self.display_url = display_url
- self.deployment_logs_url = deployment_logs_url
- self.path_mapping = path_mapping
+ super().__init__(
+ paging_type=paging_type, page_size=page_size, page_size_parameter_name=page_size_parameter_name, **kwargs
+ )
+ self.next_page_url = next_page_url
+ self.next_page_url_query_parameters = next_page_url_query_parameters
+ self.next_page_url_query_parameters_template = next_page_url_query_parameters_template
+ self.next_page_para_name = next_page_para_name
+ self.next_page_request_header = next_page_request_header
+ self.has_next_flag_json_path = has_next_flag_json_path
-class RepositoryResourceInfo(_serialization.Model):
- """Resources created in user's repository for the source-control.
+class RestApiPollerRequestPagingOffsetConfig(RestApiPollerRequestPagingConfig):
+ """The request paging configuration for Offset paging type parameters.
- :ivar webhook: The webhook object created for the source-control.
- :vartype webhook: ~azure.mgmt.securityinsight.models.Webhook
- :ivar git_hub_resource_info: Resources created in GitHub for this source-control.
- :vartype git_hub_resource_info: ~azure.mgmt.securityinsight.models.GitHubResourceInfo
- :ivar azure_dev_ops_resource_info: Resources created in Azure DevOps for this source-control.
- :vartype azure_dev_ops_resource_info:
- ~azure.mgmt.securityinsight.models.AzureDevOpsResourceInfo
+ All required parameters must be populated in order to send to server.
+
+ :ivar paging_type: Type of paging. Required. Known values are: "LinkHeader", "NextPageToken",
+ "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and "CountBasedPaging".
+ :vartype paging_type: str or ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :ivar page_size: Page size.
+ :vartype page_size: int
+ :ivar page_size_parameter_name: Page size parameter name.
+ :vartype page_size_parameter_name: str
+ :ivar offset_para_name: Offset parameter name in HTTP request.
+ :vartype offset_para_name: str
"""
+ _validation = {
+ "paging_type": {"required": True},
+ }
+
_attribute_map = {
- "webhook": {"key": "webhook", "type": "Webhook"},
- "git_hub_resource_info": {"key": "gitHubResourceInfo", "type": "GitHubResourceInfo"},
- "azure_dev_ops_resource_info": {"key": "azureDevOpsResourceInfo", "type": "AzureDevOpsResourceInfo"},
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
+ "offset_para_name": {"key": "offsetParaName", "type": "str"},
}
def __init__(
self,
*,
- webhook: Optional["_models.Webhook"] = None,
- git_hub_resource_info: Optional["_models.GitHubResourceInfo"] = None,
- azure_dev_ops_resource_info: Optional["_models.AzureDevOpsResourceInfo"] = None,
- **kwargs
- ):
- """
- :keyword webhook: The webhook object created for the source-control.
- :paramtype webhook: ~azure.mgmt.securityinsight.models.Webhook
- :keyword git_hub_resource_info: Resources created in GitHub for this source-control.
- :paramtype git_hub_resource_info: ~azure.mgmt.securityinsight.models.GitHubResourceInfo
- :keyword azure_dev_ops_resource_info: Resources created in Azure DevOps for this
- source-control.
- :paramtype azure_dev_ops_resource_info:
- ~azure.mgmt.securityinsight.models.AzureDevOpsResourceInfo
+ paging_type: Union[str, "_models.RestApiPollerRequestPagingKind"],
+ page_size: Optional[int] = None,
+ page_size_parameter_name: Optional[str] = None,
+ offset_para_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword paging_type: Type of paging. Required. Known values are: "LinkHeader",
+ "NextPageToken", "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and
+ "CountBasedPaging".
+ :paramtype paging_type: str or
+ ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :keyword page_size: Page size.
+ :paramtype page_size: int
+ :keyword page_size_parameter_name: Page size parameter name.
+ :paramtype page_size_parameter_name: str
+ :keyword offset_para_name: Offset parameter name in HTTP request.
+ :paramtype offset_para_name: str
"""
- super().__init__(**kwargs)
- self.webhook = webhook
- self.git_hub_resource_info = git_hub_resource_info
- self.azure_dev_ops_resource_info = azure_dev_ops_resource_info
+ super().__init__(
+ paging_type=paging_type, page_size=page_size, page_size_parameter_name=page_size_parameter_name, **kwargs
+ )
+ self.offset_para_name = offset_para_name
-class RequiredPermissions(_serialization.Model):
- """Required permissions for the connector.
+class RestApiPollerRequestPagingTokenConfig(RestApiPollerRequestPagingConfig):
+ """The request paging configuration for NextPageToken and PersistentToken paging type parameters.
- :ivar action: action permission.
- :vartype action: bool
- :ivar write: write permission.
- :vartype write: bool
- :ivar read: read permission.
- :vartype read: bool
- :ivar delete: delete permission.
- :vartype delete: bool
+ All required parameters must be populated in order to send to server.
+
+ :ivar paging_type: Type of paging. Required. Known values are: "LinkHeader", "NextPageToken",
+ "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and "CountBasedPaging".
+ :vartype paging_type: str or ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :ivar page_size: Page size.
+ :vartype page_size: int
+ :ivar page_size_parameter_name: Page size parameter name.
+ :vartype page_size_parameter_name: str
+ :ivar next_page_token_json_path: JSON path of next page token in HTTP response payload.
+ :vartype next_page_token_json_path: str
+ :ivar has_next_flag_json_path: JSON path of flag in HTTP response payload to indicate more
+ pages.
+ :vartype has_next_flag_json_path: str
+ :ivar next_page_token_response_header: HTTP response header name of next page token.
+ :vartype next_page_token_response_header: str
+ :ivar next_page_para_name: Next page parameter name in HTTP request.
+ :vartype next_page_para_name: str
+ :ivar next_page_request_header: Next page header name in the request.
+ :vartype next_page_request_header: str
"""
+ _validation = {
+ "paging_type": {"required": True},
+ }
+
_attribute_map = {
- "action": {"key": "action", "type": "bool"},
- "write": {"key": "write", "type": "bool"},
- "read": {"key": "read", "type": "bool"},
- "delete": {"key": "delete", "type": "bool"},
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
+ "next_page_token_json_path": {"key": "nextPageTokenJsonPath", "type": "str"},
+ "has_next_flag_json_path": {"key": "hasNextFlagJsonPath", "type": "str"},
+ "next_page_token_response_header": {"key": "nextPageTokenResponseHeader", "type": "str"},
+ "next_page_para_name": {"key": "nextPageParaName", "type": "str"},
+ "next_page_request_header": {"key": "nextPageRequestHeader", "type": "str"},
}
def __init__(
self,
*,
- action: Optional[bool] = None,
- write: Optional[bool] = None,
- read: Optional[bool] = None,
- delete: Optional[bool] = None,
- **kwargs
- ):
- """
- :keyword action: action permission.
- :paramtype action: bool
- :keyword write: write permission.
- :paramtype write: bool
- :keyword read: read permission.
- :paramtype read: bool
- :keyword delete: delete permission.
- :paramtype delete: bool
+ paging_type: Union[str, "_models.RestApiPollerRequestPagingKind"],
+ page_size: Optional[int] = None,
+ page_size_parameter_name: Optional[str] = None,
+ next_page_token_json_path: Optional[str] = None,
+ has_next_flag_json_path: Optional[str] = None,
+ next_page_token_response_header: Optional[str] = None,
+ next_page_para_name: Optional[str] = None,
+ next_page_request_header: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword paging_type: Type of paging. Required. Known values are: "LinkHeader",
+ "NextPageToken", "NextPageUrl", "PersistentToken", "PersistentLinkHeader", "Offset", and
+ "CountBasedPaging".
+ :paramtype paging_type: str or
+ ~azure.mgmt.securityinsight.models.RestApiPollerRequestPagingKind
+ :keyword page_size: Page size.
+ :paramtype page_size: int
+ :keyword page_size_parameter_name: Page size parameter name.
+ :paramtype page_size_parameter_name: str
+ :keyword next_page_token_json_path: JSON path of next page token in HTTP response payload.
+ :paramtype next_page_token_json_path: str
+ :keyword has_next_flag_json_path: JSON path of flag in HTTP response payload to indicate more
+ pages.
+ :paramtype has_next_flag_json_path: str
+ :keyword next_page_token_response_header: HTTP response header name of next page token.
+ :paramtype next_page_token_response_header: str
+ :keyword next_page_para_name: Next page parameter name in HTTP request.
+ :paramtype next_page_para_name: str
+ :keyword next_page_request_header: Next page header name in the request.
+ :paramtype next_page_request_header: str
"""
- super().__init__(**kwargs)
- self.action = action
- self.write = write
- self.read = read
- self.delete = delete
+ super().__init__(
+ paging_type=paging_type, page_size=page_size, page_size_parameter_name=page_size_parameter_name, **kwargs
+ )
+ self.next_page_token_json_path = next_page_token_json_path
+ self.has_next_flag_json_path = has_next_flag_json_path
+ self.next_page_token_response_header = next_page_token_response_header
+ self.next_page_para_name = next_page_para_name
+ self.next_page_request_header = next_page_request_header
-class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
+class ScheduledAlertRule(AlertRule):
"""Represents scheduled alert rule.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -18890,9 +13843,8 @@ class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attrib
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
:vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
:ivar query: The query that creates alerts for this rule.
:vartype query: str
@@ -18917,9 +13869,6 @@ class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attrib
:vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:ivar alert_details_override: The alert details override settings.
:vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
:ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
:vartype alert_rule_template_name: str
:ivar template_version: The version of the alert rule template used to create this rule - in
@@ -18974,7 +13923,6 @@ class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attrib
"custom_details": {"key": "properties.customDetails", "type": "{str}"},
"entity_mappings": {"key": "properties.entityMappings", "type": "[EntityMapping]"},
"alert_details_override": {"key": "properties.alertDetailsOverride", "type": "AlertDetailsOverride"},
- "sentinel_entities_mappings": {"key": "properties.sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
"alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
"template_version": {"key": "properties.templateVersion", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
@@ -19002,7 +13950,6 @@ def __init__( # pylint: disable=too-many-locals
custom_details: Optional[Dict[str, str]] = None,
entity_mappings: Optional[List["_models.EntityMapping"]] = None,
alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
alert_rule_template_name: Optional[str] = None,
template_version: Optional[str] = None,
description: Optional[str] = None,
@@ -19013,8 +13960,8 @@ def __init__( # pylint: disable=too-many-locals
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
incident_configuration: Optional["_models.IncidentConfiguration"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -19042,9 +13989,6 @@ def __init__( # pylint: disable=too-many-locals
:paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:keyword alert_details_override: The alert details override settings.
:paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
:keyword alert_rule_template_name: The Name of the alert rule template used to create this
rule.
:paramtype alert_rule_template_name: str
@@ -19083,7 +14027,6 @@ def __init__( # pylint: disable=too-many-locals
self.custom_details = custom_details
self.entity_mappings = entity_mappings
self.alert_details_override = alert_details_override
- self.sentinel_entities_mappings = sentinel_entities_mappings
self.alert_rule_template_name = alert_rule_template_name
self.template_version = template_version
self.description = description
@@ -19097,7 +14040,7 @@ def __init__( # pylint: disable=too-many-locals
self.incident_configuration = incident_configuration
-class ScheduledAlertRuleCommonProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ScheduledAlertRuleCommonProperties(_serialization.Model):
"""Scheduled alert rule template property bag.
:ivar query: The query that creates alerts for this rule.
@@ -19123,9 +14066,6 @@ class ScheduledAlertRuleCommonProperties(_serialization.Model): # pylint: disab
:vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:ivar alert_details_override: The alert details override settings.
:vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
_attribute_map = {
@@ -19139,7 +14079,6 @@ class ScheduledAlertRuleCommonProperties(_serialization.Model): # pylint: disab
"custom_details": {"key": "customDetails", "type": "{str}"},
"entity_mappings": {"key": "entityMappings", "type": "[EntityMapping]"},
"alert_details_override": {"key": "alertDetailsOverride", "type": "AlertDetailsOverride"},
- "sentinel_entities_mappings": {"key": "sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
}
def __init__(
@@ -19155,9 +14094,8 @@ def __init__(
custom_details: Optional[Dict[str, str]] = None,
entity_mappings: Optional[List["_models.EntityMapping"]] = None,
alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword query: The query that creates alerts for this rule.
:paramtype query: str
@@ -19183,9 +14121,6 @@ def __init__(
:paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:keyword alert_details_override: The alert details override settings.
:paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
super().__init__(**kwargs)
self.query = query
@@ -19198,15 +14133,14 @@ def __init__(
self.custom_details = custom_details
self.entity_mappings = entity_mappings
self.alert_details_override = alert_details_override
- self.sentinel_entities_mappings = sentinel_entities_mappings
-class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties): # pylint: disable=too-many-instance-attributes
+class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties):
"""Scheduled alert rule base property bag.
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.
+ All required parameters must be populated in order to send to server.
:ivar query: The query that creates alerts for this rule.
:vartype query: str
@@ -19231,9 +14165,6 @@ class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties): # pylin
:vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:ivar alert_details_override: The alert details override settings.
:vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
:ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
:vartype alert_rule_template_name: str
:ivar template_version: The version of the alert rule template used to create this rule - in
@@ -19281,7 +14212,6 @@ class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties): # pylin
"custom_details": {"key": "customDetails", "type": "{str}"},
"entity_mappings": {"key": "entityMappings", "type": "[EntityMapping]"},
"alert_details_override": {"key": "alertDetailsOverride", "type": "AlertDetailsOverride"},
- "sentinel_entities_mappings": {"key": "sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
"alert_rule_template_name": {"key": "alertRuleTemplateName", "type": "str"},
"template_version": {"key": "templateVersion", "type": "str"},
"description": {"key": "description", "type": "str"},
@@ -19312,15 +14242,14 @@ def __init__(
custom_details: Optional[Dict[str, str]] = None,
entity_mappings: Optional[List["_models.EntityMapping"]] = None,
alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
alert_rule_template_name: Optional[str] = None,
template_version: Optional[str] = None,
description: Optional[str] = None,
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
incident_configuration: Optional["_models.IncidentConfiguration"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword query: The query that creates alerts for this rule.
:paramtype query: str
@@ -19346,9 +14275,6 @@ def __init__(
:paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:keyword alert_details_override: The alert details override settings.
:paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
:keyword alert_rule_template_name: The Name of the alert rule template used to create this
rule.
:paramtype alert_rule_template_name: str
@@ -19386,7 +14312,6 @@ def __init__(
custom_details=custom_details,
entity_mappings=entity_mappings,
alert_details_override=alert_details_override,
- sentinel_entities_mappings=sentinel_entities_mappings,
**kwargs
)
self.alert_rule_template_name = alert_rule_template_name
@@ -19402,15 +14327,15 @@ def __init__(
self.incident_configuration = incident_configuration
-class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
+class ScheduledAlertRuleTemplate(AlertRuleTemplate):
"""Represents scheduled alert rule template.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -19420,9 +14345,8 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
+ :ivar kind: The alert rule kind. Required. Known values are: "Scheduled",
+ "MicrosoftSecurityIncidentCreation", and "Fusion".
:vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
:ivar alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -19457,7 +14381,7 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
:vartype trigger_threshold: int
:ivar tactics: The tactics of the alert rule template.
:vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
+ :ivar techniques: The techniques of the alert rule template.
:vartype techniques: list[str]
:ivar version: The version of this template - in format , where all are numbers. For
example <1.0.2>.
@@ -19471,9 +14395,6 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
:vartype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:ivar alert_details_override: The alert details override settings.
:vartype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :ivar sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :vartype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
_validation = {
@@ -19515,7 +14436,6 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
"custom_details": {"key": "properties.customDetails", "type": "{str}"},
"entity_mappings": {"key": "properties.entityMappings", "type": "[EntityMapping]"},
"alert_details_override": {"key": "properties.alertDetailsOverride", "type": "AlertDetailsOverride"},
- "sentinel_entities_mappings": {"key": "properties.sentinelEntitiesMappings", "type": "[SentinelEntityMapping]"},
}
def __init__( # pylint: disable=too-many-locals
@@ -19539,9 +14459,8 @@ def __init__( # pylint: disable=too-many-locals
custom_details: Optional[Dict[str, str]] = None,
entity_mappings: Optional[List["_models.EntityMapping"]] = None,
alert_details_override: Optional["_models.AlertDetailsOverride"] = None,
- sentinel_entities_mappings: Optional[List["_models.SentinelEntityMapping"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -19573,7 +14492,7 @@ def __init__( # pylint: disable=too-many-locals
:paramtype trigger_threshold: int
:keyword tactics: The tactics of the alert rule template.
:paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
+ :keyword techniques: The techniques of the alert rule template.
:paramtype techniques: list[str]
:keyword version: The version of this template - in format , where all are numbers. For
example <1.0.2>.
@@ -19587,9 +14506,6 @@ def __init__( # pylint: disable=too-many-locals
:paramtype entity_mappings: list[~azure.mgmt.securityinsight.models.EntityMapping]
:keyword alert_details_override: The alert details override settings.
:paramtype alert_details_override: ~azure.mgmt.securityinsight.models.AlertDetailsOverride
- :keyword sentinel_entities_mappings: Array of the sentinel entity mappings of the alert rule.
- :paramtype sentinel_entities_mappings:
- list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
super().__init__(**kwargs)
self.kind: str = "Scheduled"
@@ -19613,18 +14529,17 @@ def __init__( # pylint: disable=too-many-locals
self.custom_details = custom_details
self.entity_mappings = entity_mappings
self.alert_details_override = alert_details_override
- self.sentinel_entities_mappings = sentinel_entities_mappings
-class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
+class SecurityAlert(Entity):
"""Represents a security alert entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -19637,8 +14552,8 @@ class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -19784,8 +14699,8 @@ class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
}
def __init__( # pylint: disable=too-many-locals
- self, *, severity: Optional[Union[str, "_models.AlertSeverity"]] = None, **kwargs
- ):
+ self, *, severity: Optional[Union[str, "_models.AlertSeverity"]] = None, **kwargs: Any
+ ) -> None:
"""
:keyword severity: The severity of the alert. Known values are: "High", "Medium", "Low", and
"Informational".
@@ -19822,7 +14737,7 @@ def __init__( # pylint: disable=too-many-locals
self.resource_identifiers = None
-class SecurityAlertProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
+class SecurityAlertProperties(EntityCommonProperties):
"""SecurityAlert entity property bag.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -19959,8 +14874,8 @@ class SecurityAlertProperties(EntityCommonProperties): # pylint: disable=too-ma
}
def __init__( # pylint: disable=too-many-locals
- self, *, severity: Optional[Union[str, "_models.AlertSeverity"]] = None, **kwargs
- ):
+ self, *, severity: Optional[Union[str, "_models.AlertSeverity"]] = None, **kwargs: Any
+ ) -> None:
"""
:keyword severity: The severity of the alert. Known values are: "High", "Medium", "Low", and
"Informational".
@@ -19994,7 +14909,7 @@ def __init__( # pylint: disable=too-many-locals
self.resource_identifiers = None
-class SecurityAlertPropertiesConfidenceReasonsItem(_serialization.Model):
+class SecurityAlertPropertiesConfidenceReasonsItem(_serialization.Model): # pylint: disable=name-too-long
"""confidence reason item.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -20015,140 +14930,22 @@ class SecurityAlertPropertiesConfidenceReasonsItem(_serialization.Model):
"reason_type": {"key": "reasonType", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.reason = None
self.reason_type = None
-class SecurityAlertTimelineItem(EntityTimelineItem): # pylint: disable=too-many-instance-attributes
- """Represents security alert timeline item.
-
- 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 kind: The entity query kind type. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- :ivar azure_resource_id: The alert azure resource id. Required.
- :vartype azure_resource_id: str
- :ivar product_name: The alert product name.
- :vartype product_name: str
- :ivar description: The alert description.
- :vartype description: str
- :ivar display_name: The alert name. Required.
- :vartype display_name: str
- :ivar severity: The alert severity. Required. Known values are: "High", "Medium", "Low", and
- "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar end_time_utc: The alert end time. Required.
- :vartype end_time_utc: ~datetime.datetime
- :ivar start_time_utc: The alert start time. Required.
- :vartype start_time_utc: ~datetime.datetime
- :ivar time_generated: The alert generated time. Required.
- :vartype time_generated: ~datetime.datetime
- :ivar alert_type: The name of the alert type. Required.
- :vartype alert_type: str
- :ivar intent: The intent of the alert. Known values are: "Unknown", "Probing", "Exploitation",
- "Persistence", "PrivilegeEscalation", "DefenseEvasion", "CredentialAccess", "Discovery",
- "LateralMovement", "Execution", "Collection", "Exfiltration", "CommandAndControl", and
- "Impact".
- :vartype intent: str or ~azure.mgmt.securityinsight.models.KillChainIntent
- :ivar techniques: The techniques of the alert.
- :vartype techniques: list[str]
- """
-
- _validation = {
- "kind": {"required": True},
- "azure_resource_id": {"required": True},
- "display_name": {"required": True},
- "severity": {"required": True},
- "end_time_utc": {"required": True},
- "start_time_utc": {"required": True},
- "time_generated": {"required": True},
- "alert_type": {"required": True},
- "intent": {"readonly": True},
- }
-
- _attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "azure_resource_id": {"key": "azureResourceId", "type": "str"},
- "product_name": {"key": "productName", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "severity": {"key": "severity", "type": "str"},
- "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"},
- "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"},
- "time_generated": {"key": "timeGenerated", "type": "iso-8601"},
- "alert_type": {"key": "alertType", "type": "str"},
- "intent": {"key": "intent", "type": "str"},
- "techniques": {"key": "techniques", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- azure_resource_id: str,
- display_name: str,
- severity: Union[str, "_models.AlertSeverity"],
- end_time_utc: datetime.datetime,
- start_time_utc: datetime.datetime,
- time_generated: datetime.datetime,
- alert_type: str,
- product_name: Optional[str] = None,
- description: Optional[str] = None,
- techniques: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword azure_resource_id: The alert azure resource id. Required.
- :paramtype azure_resource_id: str
- :keyword product_name: The alert product name.
- :paramtype product_name: str
- :keyword description: The alert description.
- :paramtype description: str
- :keyword display_name: The alert name. Required.
- :paramtype display_name: str
- :keyword severity: The alert severity. Required. Known values are: "High", "Medium", "Low", and
- "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :keyword end_time_utc: The alert end time. Required.
- :paramtype end_time_utc: ~datetime.datetime
- :keyword start_time_utc: The alert start time. Required.
- :paramtype start_time_utc: ~datetime.datetime
- :keyword time_generated: The alert generated time. Required.
- :paramtype time_generated: ~datetime.datetime
- :keyword alert_type: The name of the alert type. Required.
- :paramtype alert_type: str
- :keyword techniques: The techniques of the alert.
- :paramtype techniques: list[str]
- """
- super().__init__(**kwargs)
- self.kind: str = "SecurityAlert"
- self.azure_resource_id = azure_resource_id
- self.product_name = product_name
- self.description = description
- self.display_name = display_name
- self.severity = severity
- self.end_time_utc = end_time_utc
- self.start_time_utc = start_time_utc
- self.time_generated = time_generated
- self.alert_type = alert_type
- self.intent = None
- self.techniques = techniques
-
-
class SecurityGroupEntity(Entity):
"""Represents a security group entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -20161,8 +14958,8 @@ class SecurityGroupEntity(Entity):
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -20205,7 +15002,7 @@ class SecurityGroupEntity(Entity):
"sid": {"key": "properties.sid", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: str = "SecurityGroup"
@@ -20253,7 +15050,7 @@ class SecurityGroupEntityProperties(EntityCommonProperties):
"sid": {"key": "sid", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.distinguished_name = None
@@ -20275,7 +15072,9 @@ class SecurityMLAnalyticsSettingsDataSource(_serialization.Model):
"data_types": {"key": "dataTypes", "type": "[str]"},
}
- def __init__(self, *, connector_id: Optional[str] = None, data_types: Optional[List[str]] = None, **kwargs):
+ def __init__(
+ self, *, connector_id: Optional[str] = None, data_types: Optional[List[str]] = None, **kwargs: Any
+ ) -> None:
"""
:keyword connector_id: The connector id that provides the following data types.
:paramtype connector_id: str
@@ -20292,7 +15091,7 @@ class SecurityMLAnalyticsSettingsList(_serialization.Model):
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.
+ All required parameters must be populated in order to send to server.
:ivar next_link: URL to fetch the next set of SecurityMLAnalyticsSettings.
:vartype next_link: str
@@ -20302,42 +15101,22 @@ class SecurityMLAnalyticsSettingsList(_serialization.Model):
_validation = {
"next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[SecurityMLAnalyticsSetting]"},
- }
-
- def __init__(self, *, value: List["_models.SecurityMLAnalyticsSetting"], **kwargs):
- """
- :keyword value: Array of SecurityMLAnalyticsSettings. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class SentinelEntityMapping(_serialization.Model):
- """A single sentinel entity mapping.
-
- :ivar column_name: the column name to be mapped to the SentinelEntities.
- :vartype column_name: str
- """
+ "value": {"required": True},
+ }
_attribute_map = {
- "column_name": {"key": "columnName", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[SecurityMLAnalyticsSetting]"},
}
- def __init__(self, *, column_name: Optional[str] = None, **kwargs):
+ def __init__(self, *, value: List["_models.SecurityMLAnalyticsSetting"], **kwargs: Any) -> None:
"""
- :keyword column_name: the column name to be mapped to the SentinelEntities.
- :paramtype column_name: str
+ :keyword value: Array of SecurityMLAnalyticsSettings. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting]
"""
super().__init__(**kwargs)
- self.column_name = column_name
+ self.next_link = None
+ self.value = value
class SentinelOnboardingState(ResourceWithEtag):
@@ -20345,8 +15124,8 @@ class SentinelOnboardingState(ResourceWithEtag):
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -20378,7 +15157,9 @@ class SentinelOnboardingState(ResourceWithEtag):
"customer_managed_key": {"key": "properties.customerManagedKey", "type": "bool"},
}
- def __init__(self, *, etag: Optional[str] = None, customer_managed_key: Optional[bool] = None, **kwargs):
+ def __init__(
+ self, *, etag: Optional[str] = None, customer_managed_key: Optional[bool] = None, **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -20392,7 +15173,7 @@ def __init__(self, *, etag: Optional[str] = None, customer_managed_key: Optional
class SentinelOnboardingStatesList(_serialization.Model):
"""List of the Sentinel onboarding states.
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
:ivar value: Array of Sentinel onboarding states. Required.
:vartype value: list[~azure.mgmt.securityinsight.models.SentinelOnboardingState]
@@ -20406,7 +15187,7 @@ class SentinelOnboardingStatesList(_serialization.Model):
"value": {"key": "value", "type": "[SentinelOnboardingState]"},
}
- def __init__(self, *, value: List["_models.SentinelOnboardingState"], **kwargs):
+ def __init__(self, *, value: List["_models.SentinelOnboardingState"], **kwargs: Any) -> None:
"""
:keyword value: Array of Sentinel onboarding states. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.SentinelOnboardingState]
@@ -20415,39 +15196,142 @@ def __init__(self, *, value: List["_models.SentinelOnboardingState"], **kwargs):
self.value = value
-class SettingList(_serialization.Model):
- """List of all the settings.
+class ServicePrincipal(_serialization.Model):
+ """Service principal metadata.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar value: Array of settings. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Settings]
+ :ivar id: Id of service principal.
+ :vartype id: str
+ :ivar tenant_id: Tenant id of service principal.
+ :vartype tenant_id: str
+ :ivar app_id: App id of service principal.
+ :vartype app_id: str
+ :ivar credentials_expire_on: Expiration time of service principal credentials.
+ :vartype credentials_expire_on: ~datetime.datetime
"""
_validation = {
- "value": {"required": True},
+ "id": {"readonly": True},
+ "tenant_id": {"readonly": True},
+ "app_id": {"readonly": True},
}
_attribute_map = {
- "value": {"key": "value", "type": "[Settings]"},
+ "id": {"key": "id", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "app_id": {"key": "appId", "type": "str"},
+ "credentials_expire_on": {"key": "credentialsExpireOn", "type": "iso-8601"},
}
- def __init__(self, *, value: List["_models.Settings"], **kwargs):
+ def __init__(self, *, credentials_expire_on: Optional[datetime.datetime] = None, **kwargs: Any) -> None:
"""
- :keyword value: Array of settings. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Settings]
+ :keyword credentials_expire_on: Expiration time of service principal credentials.
+ :paramtype credentials_expire_on: ~datetime.datetime
"""
super().__init__(**kwargs)
- self.value = value
+ self.id = None
+ self.tenant_id = None
+ self.app_id = None
+ self.credentials_expire_on = credentials_expire_on
+
+
+class SessionAuthModel(CcpAuthConfig):
+ """Model for API authentication with session cookie.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: The auth type. Required. Known values are: "Basic", "APIKey", "OAuth2", "AWS",
+ "GCP", "Session", "JwtToken", "GitHub", "ServiceBus", "Oracle", and "None".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.CcpAuthType
+ :ivar user_name: The user name attribute key value. Required.
+ :vartype user_name: dict[str, str]
+ :ivar password: The password attribute name. Required.
+ :vartype password: dict[str, str]
+ :ivar query_parameters: Query parameters to session service endpoint.
+ :vartype query_parameters: dict[str, any]
+ :ivar is_post_payload_json: Indicating whether API key is set in HTTP POST payload.
+ :vartype is_post_payload_json: bool
+ :ivar headers: HTTP request headers to session service endpoint.
+ :vartype headers: dict[str, str]
+ :ivar session_timeout_in_minutes: Session timeout in minutes.
+ :vartype session_timeout_in_minutes: int
+ :ivar session_id_name: Session id attribute name from HTTP response header.
+ :vartype session_id_name: str
+ :ivar session_login_request_uri: HTTP request URL to session service endpoint.
+ :vartype session_login_request_uri: str
+ """
+
+ _validation = {
+ "type": {"required": True},
+ "user_name": {"required": True},
+ "password": {"required": True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "user_name": {"key": "userName", "type": "{str}"},
+ "password": {"key": "password", "type": "{str}"},
+ "query_parameters": {"key": "queryParameters", "type": "{object}"},
+ "is_post_payload_json": {"key": "isPostPayloadJson", "type": "bool"},
+ "headers": {"key": "headers", "type": "{str}"},
+ "session_timeout_in_minutes": {"key": "sessionTimeoutInMinutes", "type": "int"},
+ "session_id_name": {"key": "sessionIdName", "type": "str"},
+ "session_login_request_uri": {"key": "sessionLoginRequestUri", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ user_name: Dict[str, str],
+ password: Dict[str, str],
+ query_parameters: Optional[Dict[str, Any]] = None,
+ is_post_payload_json: Optional[bool] = None,
+ headers: Optional[Dict[str, str]] = None,
+ session_timeout_in_minutes: Optional[int] = None,
+ session_id_name: Optional[str] = None,
+ session_login_request_uri: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword user_name: The user name attribute key value. Required.
+ :paramtype user_name: dict[str, str]
+ :keyword password: The password attribute name. Required.
+ :paramtype password: dict[str, str]
+ :keyword query_parameters: Query parameters to session service endpoint.
+ :paramtype query_parameters: dict[str, any]
+ :keyword is_post_payload_json: Indicating whether API key is set in HTTP POST payload.
+ :paramtype is_post_payload_json: bool
+ :keyword headers: HTTP request headers to session service endpoint.
+ :paramtype headers: dict[str, str]
+ :keyword session_timeout_in_minutes: Session timeout in minutes.
+ :paramtype session_timeout_in_minutes: int
+ :keyword session_id_name: Session id attribute name from HTTP response header.
+ :paramtype session_id_name: str
+ :keyword session_login_request_uri: HTTP request URL to session service endpoint.
+ :paramtype session_login_request_uri: str
+ """
+ super().__init__(**kwargs)
+ self.type: str = "Session"
+ self.user_name = user_name
+ self.password = password
+ self.query_parameters = query_parameters
+ self.is_post_payload_json = is_post_payload_json
+ self.headers = headers
+ self.session_timeout_in_minutes = session_timeout_in_minutes
+ self.session_id_name = session_id_name
+ self.session_login_request_uri = session_login_request_uri
-class SourceControl(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+class SourceControl(ResourceWithEtag):
"""Represents a SourceControl in Azure Security Insights.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -20464,22 +15348,29 @@ class SourceControl(ResourceWithEtag): # pylint: disable=too-many-instance-attr
:ivar version: The version number associated with the source control. Known values are: "V1"
and "V2".
:vartype version: str or ~azure.mgmt.securityinsight.models.Version
- :ivar display_name: The display name of the source control.
+ :ivar display_name: The display name of the source control. Required.
:vartype display_name: str
:ivar description: A description of the source control.
:vartype description: str
- :ivar repo_type: The repository type of the source control. Known values are: "Github" and
- "DevOps".
+ :ivar repo_type: The repository type of the source control. Required. Known values are:
+ "Github" and "AzureDevOps".
:vartype repo_type: str or ~azure.mgmt.securityinsight.models.RepoType
- :ivar content_types: Array of source control content types.
+ :ivar content_types: Array of source control content types. Required.
:vartype content_types: list[str or ~azure.mgmt.securityinsight.models.ContentType]
- :ivar repository: Repository metadata.
+ :ivar repository: Repository metadata. Required.
:vartype repository: ~azure.mgmt.securityinsight.models.Repository
+ :ivar service_principal: Service principal metadata.
+ :vartype service_principal: ~azure.mgmt.securityinsight.models.ServicePrincipal
+ :ivar repository_access: Repository access credentials. This is write-only object and it never
+ returns back to a user.
+ :vartype repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccess
:ivar repository_resource_info: Information regarding the resources created in user's
repository.
:vartype repository_resource_info: ~azure.mgmt.securityinsight.models.RepositoryResourceInfo
:ivar last_deployment_info: Information regarding the latest deployment for the source control.
:vartype last_deployment_info: ~azure.mgmt.securityinsight.models.DeploymentInfo
+ :ivar pull_request: Information regarding the pull request of the source control.
+ :vartype pull_request: ~azure.mgmt.securityinsight.models.PullRequest
"""
_validation = {
@@ -20487,6 +15378,14 @@ class SourceControl(ResourceWithEtag): # pylint: disable=too-many-instance-attr
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
+ "id_properties_id": {"readonly": True},
+ "version": {"readonly": True},
+ "display_name": {"required": True},
+ "repo_type": {"required": True},
+ "content_types": {"required": True},
+ "repository": {"required": True},
+ "last_deployment_info": {"readonly": True},
+ "pull_request": {"readonly": True},
}
_attribute_map = {
@@ -20502,61 +15401,63 @@ class SourceControl(ResourceWithEtag): # pylint: disable=too-many-instance-attr
"repo_type": {"key": "properties.repoType", "type": "str"},
"content_types": {"key": "properties.contentTypes", "type": "[str]"},
"repository": {"key": "properties.repository", "type": "Repository"},
+ "service_principal": {"key": "properties.servicePrincipal", "type": "ServicePrincipal"},
+ "repository_access": {"key": "properties.repositoryAccess", "type": "RepositoryAccess"},
"repository_resource_info": {"key": "properties.repositoryResourceInfo", "type": "RepositoryResourceInfo"},
"last_deployment_info": {"key": "properties.lastDeploymentInfo", "type": "DeploymentInfo"},
+ "pull_request": {"key": "properties.pullRequest", "type": "PullRequest"},
}
def __init__(
self,
*,
+ display_name: str,
+ repo_type: Union[str, "_models.RepoType"],
+ content_types: List[Union[str, "_models.ContentType"]],
+ repository: "_models.Repository",
etag: Optional[str] = None,
- id_properties_id: Optional[str] = None,
- version: Optional[Union[str, "_models.Version"]] = None,
- display_name: Optional[str] = None,
description: Optional[str] = None,
- repo_type: Optional[Union[str, "_models.RepoType"]] = None,
- content_types: Optional[List[Union[str, "_models.ContentType"]]] = None,
- repository: Optional["_models.Repository"] = None,
+ service_principal: Optional["_models.ServicePrincipal"] = None,
+ repository_access: Optional["_models.RepositoryAccess"] = None,
repository_resource_info: Optional["_models.RepositoryResourceInfo"] = None,
- last_deployment_info: Optional["_models.DeploymentInfo"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword id_properties_id: The id (a Guid) of the source control.
- :paramtype id_properties_id: str
- :keyword version: The version number associated with the source control. Known values are: "V1"
- and "V2".
- :paramtype version: str or ~azure.mgmt.securityinsight.models.Version
- :keyword display_name: The display name of the source control.
+ :keyword display_name: The display name of the source control. Required.
:paramtype display_name: str
:keyword description: A description of the source control.
:paramtype description: str
- :keyword repo_type: The repository type of the source control. Known values are: "Github" and
- "DevOps".
+ :keyword repo_type: The repository type of the source control. Required. Known values are:
+ "Github" and "AzureDevOps".
:paramtype repo_type: str or ~azure.mgmt.securityinsight.models.RepoType
- :keyword content_types: Array of source control content types.
+ :keyword content_types: Array of source control content types. Required.
:paramtype content_types: list[str or ~azure.mgmt.securityinsight.models.ContentType]
- :keyword repository: Repository metadata.
+ :keyword repository: Repository metadata. Required.
:paramtype repository: ~azure.mgmt.securityinsight.models.Repository
+ :keyword service_principal: Service principal metadata.
+ :paramtype service_principal: ~azure.mgmt.securityinsight.models.ServicePrincipal
+ :keyword repository_access: Repository access credentials. This is write-only object and it
+ never returns back to a user.
+ :paramtype repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccess
:keyword repository_resource_info: Information regarding the resources created in user's
repository.
:paramtype repository_resource_info: ~azure.mgmt.securityinsight.models.RepositoryResourceInfo
- :keyword last_deployment_info: Information regarding the latest deployment for the source
- control.
- :paramtype last_deployment_info: ~azure.mgmt.securityinsight.models.DeploymentInfo
"""
super().__init__(etag=etag, **kwargs)
- self.id_properties_id = id_properties_id
- self.version = version
+ self.id_properties_id = None
+ self.version = None
self.display_name = display_name
self.description = description
self.repo_type = repo_type
self.content_types = content_types
self.repository = repository
+ self.service_principal = service_principal
+ self.repository_access = repository_access
self.repository_resource_info = repository_resource_info
- self.last_deployment_info = last_deployment_info
+ self.last_deployment_info = None
+ self.pull_request = None
class SourceControlList(_serialization.Model):
@@ -20564,7 +15465,7 @@ class SourceControlList(_serialization.Model):
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.
+ All required parameters must be populated in order to send to server.
:ivar next_link: URL to fetch the next set of source controls.
:vartype next_link: str
@@ -20582,7 +15483,7 @@ class SourceControlList(_serialization.Model):
"value": {"key": "value", "type": "[SourceControl]"},
}
- def __init__(self, *, value: List["_models.SourceControl"], **kwargs):
+ def __init__(self, *, value: List["_models.SourceControl"], **kwargs: Any) -> None:
"""
:keyword value: Array of source controls. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.SourceControl]
@@ -20592,15 +15493,15 @@ def __init__(self, *, value: List["_models.SourceControl"], **kwargs):
self.value = value
-class SubmissionMailEntity(Entity): # pylint: disable=too-many-instance-attributes
+class SubmissionMailEntity(Entity):
"""Represents a submission mail entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -20613,8 +15514,8 @@ class SubmissionMailEntity(Entity): # pylint: disable=too-many-instance-attribu
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -20684,7 +15585,7 @@ class SubmissionMailEntity(Entity): # pylint: disable=too-many-instance-attribu
"report_type": {"key": "properties.reportType", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: str = "SubmissionMail"
@@ -20702,7 +15603,7 @@ def __init__(self, **kwargs):
self.report_type = None
-class SubmissionMailEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
+class SubmissionMailEntityProperties(EntityCommonProperties):
"""Submission mail entity property bag.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -20766,7 +15667,7 @@ class SubmissionMailEntityProperties(EntityCommonProperties): # pylint: disable
"report_type": {"key": "reportType", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.network_message_id = None
@@ -20818,8 +15719,8 @@ def __init__(
last_modified_by: Optional[str] = None,
last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
last_modified_at: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword created_by: The identity that created the resource.
:paramtype created_by: str
@@ -20845,159 +15746,76 @@ def __init__(
self.last_modified_at = last_modified_at
-class TeamInformation(_serialization.Model):
- """Describes team information.
+class TemplateAdditionalProperties(_serialization.Model):
+ """additional properties of product template.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar team_id: Team ID.
- :vartype team_id: str
- :ivar primary_channel_url: The primary channel URL of the team.
- :vartype primary_channel_url: str
- :ivar team_creation_time_utc: The time the team was created.
- :vartype team_creation_time_utc: ~datetime.datetime
- :ivar name: The name of the team.
- :vartype name: str
- :ivar description: The description of the team.
- :vartype description: str
- """
-
- _validation = {
- "team_id": {"readonly": True},
- "primary_channel_url": {"readonly": True},
- "team_creation_time_utc": {"readonly": True},
- "name": {"readonly": True},
- "description": {"readonly": True},
- }
-
- _attribute_map = {
- "team_id": {"key": "teamId", "type": "str"},
- "primary_channel_url": {"key": "primaryChannelUrl", "type": "str"},
- "team_creation_time_utc": {"key": "teamCreationTimeUtc", "type": "iso-8601"},
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.team_id = None
- self.primary_channel_url = None
- self.team_creation_time_utc = None
- self.name = None
- self.description = None
-
-
-class TeamProperties(_serialization.Model):
- """Describes team properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar team_name: The name of the team. Required.
- :vartype team_name: str
- :ivar team_description: The description of the team.
- :vartype team_description: str
- :ivar group_ids: List of group IDs to add their members to the team.
- :vartype group_ids: list[str]
- :ivar member_ids: List of member IDs to add to the team.
- :vartype member_ids: list[str]
+ :ivar main_template: The JSON of the ARM template to deploy active content. Expandable.
+ :vartype main_template: JSON
+ :ivar dependant_templates: Dependant templates. Expandable.
+ :vartype dependant_templates: list[~azure.mgmt.securityinsight.models.TemplateProperties]
"""
_validation = {
- "team_name": {"required": True},
+ "dependant_templates": {"readonly": True},
}
_attribute_map = {
- "team_name": {"key": "teamName", "type": "str"},
- "team_description": {"key": "teamDescription", "type": "str"},
- "group_ids": {"key": "groupIds", "type": "[str]"},
- "member_ids": {"key": "memberIds", "type": "[str]"},
+ "main_template": {"key": "mainTemplate", "type": "object"},
+ "dependant_templates": {"key": "dependantTemplates", "type": "[TemplateProperties]"},
}
- def __init__(
- self,
- *,
- team_name: str,
- team_description: Optional[str] = None,
- group_ids: Optional[List[str]] = None,
- member_ids: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword team_name: The name of the team. Required.
- :paramtype team_name: str
- :keyword team_description: The description of the team.
- :paramtype team_description: str
- :keyword group_ids: List of group IDs to add their members to the team.
- :paramtype group_ids: list[str]
- :keyword member_ids: List of member IDs to add to the team.
- :paramtype member_ids: list[str]
+ def __init__(self, *, main_template: Optional[JSON] = None, **kwargs: Any) -> None:
+ """
+ :keyword main_template: The JSON of the ARM template to deploy active content. Expandable.
+ :paramtype main_template: JSON
"""
super().__init__(**kwargs)
- self.team_name = team_name
- self.team_description = team_description
- self.group_ids = group_ids
- self.member_ids = member_ids
+ self.main_template = main_template
+ self.dependant_templates = None
-class ThreatIntelligence(_serialization.Model):
- """ThreatIntelligence property bag.
+class TemplateList(_serialization.Model):
+ """List of all the template.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar confidence: Confidence (must be between 0 and 1).
- :vartype confidence: float
- :ivar provider_name: Name of the provider from whom this Threat Intelligence information was
- received.
- :vartype provider_name: str
- :ivar report_link: Report link.
- :vartype report_link: str
- :ivar threat_description: Threat description (free text).
- :vartype threat_description: str
- :ivar threat_name: Threat name (e.g. "Jedobot malware").
- :vartype threat_name: str
- :ivar threat_type: Threat type (e.g. "Botnet").
- :vartype threat_type: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar value: Array of templates. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.TemplateModel]
+ :ivar next_link: URL to fetch the next page of template.
+ :vartype next_link: str
"""
_validation = {
- "confidence": {"readonly": True},
- "provider_name": {"readonly": True},
- "report_link": {"readonly": True},
- "threat_description": {"readonly": True},
- "threat_name": {"readonly": True},
- "threat_type": {"readonly": True},
+ "value": {"required": True},
+ "next_link": {"readonly": True},
}
_attribute_map = {
- "confidence": {"key": "confidence", "type": "float"},
- "provider_name": {"key": "providerName", "type": "str"},
- "report_link": {"key": "reportLink", "type": "str"},
- "threat_description": {"key": "threatDescription", "type": "str"},
- "threat_name": {"key": "threatName", "type": "str"},
- "threat_type": {"key": "threatType", "type": "str"},
+ "value": {"key": "value", "type": "[TemplateModel]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(self, *, value: List["_models.TemplateModel"], **kwargs: Any) -> None:
+ """
+ :keyword value: Array of templates. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.TemplateModel]
+ """
super().__init__(**kwargs)
- self.confidence = None
- self.provider_name = None
- self.report_link = None
- self.threat_description = None
- self.threat_name = None
- self.threat_type = None
+ self.value = value
+ self.next_link = None
-class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents Threat Intelligence alert rule.
+class TemplateModel(ResourceWithEtag):
+ """Template resource definition.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -21009,27 +15827,80 @@ class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instan
:vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
:ivar etag: Etag of the azure resource.
:vartype etag: str
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rule_template_name: The Name of the alert rule template used to create this rule.
- :vartype alert_rule_template_name: str
- :ivar description: The description of the alert rule.
- :vartype description: str
- :ivar display_name: The display name for alerts created by this alert rule.
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :vartype content_product_id: str
+ :ivar package_version: Version of the package. Default and recommended format is numeric (e.g.
+ 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but
+ then we cannot guarantee any version checks.
+ :vartype package_version: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar display_name: The display name of the template.
:vartype display_name: str
- :ivar enabled: Determines whether this alert rule is enabled or disabled.
- :vartype enabled: bool
- :ivar last_modified_utc: The last time that this alert has been modified.
- :vartype last_modified_utc: ~datetime.datetime
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
+ :ivar content_kind: The kind of content the template is for. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the template - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
+ :ivar package_id: the package Id contains this template.
+ :vartype package_id: str
+ :ivar package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :vartype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar package_name: the name of the package contains this template.
+ :vartype package_name: str
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
+ :ivar main_template: The JSON of the ARM template to deploy active content. Expandable.
+ :vartype main_template: JSON
+ :ivar dependant_templates: Dependant templates. Expandable.
+ :vartype dependant_templates: list[~azure.mgmt.securityinsight.models.TemplateProperties]
"""
_validation = {
@@ -21037,13 +15908,8 @@ class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instan
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
- "kind": {"required": True},
- "description": {"readonly": True},
- "display_name": {"readonly": True},
- "last_modified_utc": {"readonly": True},
- "severity": {"readonly": True},
- "tactics": {"readonly": True},
- "techniques": {"readonly": True},
+ "is_deprecated": {"readonly": True},
+ "dependant_templates": {"readonly": True},
}
_attribute_map = {
@@ -21052,272 +15918,490 @@ class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instan
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rule_template_name": {"key": "properties.alertRuleTemplateName", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
+ "content_id": {"key": "properties.contentId", "type": "str"},
+ "content_product_id": {"key": "properties.contentProductId", "type": "str"},
+ "package_version": {"key": "properties.packageVersion", "type": "str"},
+ "version": {"key": "properties.version", "type": "str"},
"display_name": {"key": "properties.displayName", "type": "str"},
- "enabled": {"key": "properties.enabled", "type": "bool"},
- "last_modified_utc": {"key": "properties.lastModifiedUtc", "type": "iso-8601"},
- "severity": {"key": "properties.severity", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
+ "content_kind": {"key": "properties.contentKind", "type": "str"},
+ "source": {"key": "properties.source", "type": "MetadataSource"},
+ "author": {"key": "properties.author", "type": "MetadataAuthor"},
+ "support": {"key": "properties.support", "type": "MetadataSupport"},
+ "dependencies": {"key": "properties.dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "properties.categories", "type": "MetadataCategories"},
+ "providers": {"key": "properties.providers", "type": "[str]"},
+ "first_publish_date": {"key": "properties.firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "properties.lastPublishDate", "type": "date"},
+ "custom_version": {"key": "properties.customVersion", "type": "str"},
+ "content_schema_version": {"key": "properties.contentSchemaVersion", "type": "str"},
+ "icon": {"key": "properties.icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "properties.threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "properties.threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "properties.previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "properties.previewImagesDark", "type": "[str]"},
+ "package_id": {"key": "properties.packageId", "type": "str"},
+ "package_kind": {"key": "properties.packageKind", "type": "str"},
+ "package_name": {"key": "properties.packageName", "type": "str"},
+ "is_deprecated": {"key": "properties.isDeprecated", "type": "str"},
+ "main_template": {"key": "properties.mainTemplate", "type": "object"},
+ "dependant_templates": {"key": "properties.dependantTemplates", "type": "[TemplateProperties]"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
etag: Optional[str] = None,
- alert_rule_template_name: Optional[str] = None,
- enabled: Optional[bool] = None,
- **kwargs
- ):
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ package_version: Optional[str] = None,
+ version: Optional[str] = None,
+ display_name: Optional[str] = None,
+ content_kind: Optional[Union[str, "_models.Kind"]] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ package_id: Optional[str] = None,
+ package_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ package_name: Optional[str] = None,
+ main_template: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword alert_rule_template_name: The Name of the alert rule template used to create this
- rule.
- :paramtype alert_rule_template_name: str
- :keyword enabled: Determines whether this alert rule is enabled or disabled.
- :paramtype enabled: bool
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :paramtype content_product_id: str
+ :keyword package_version: Version of the package. Default and recommended format is numeric
+ (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string,
+ but then we cannot guarantee any version checks.
+ :paramtype package_version: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword display_name: The display name of the template.
+ :paramtype display_name: str
+ :keyword content_kind: The kind of content the template is for. Known values are:
+ "DataConnector", "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the template - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
+ :keyword package_id: the package Id contains this template.
+ :paramtype package_id: str
+ :keyword package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :paramtype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword package_name: the name of the package contains this template.
+ :paramtype package_name: str
+ :keyword main_template: The JSON of the ARM template to deploy active content. Expandable.
+ :paramtype main_template: JSON
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "ThreatIntelligence"
- self.alert_rule_template_name = alert_rule_template_name
- self.description = None
- self.display_name = None
- self.enabled = enabled
- self.last_modified_utc = None
- self.severity = None
- self.tactics = None
- self.techniques = None
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.package_version = package_version
+ self.version = version
+ self.display_name = display_name
+ self.content_kind = content_kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
+ self.package_id = package_id
+ self.package_kind = package_kind
+ self.package_name = package_name
+ self.is_deprecated = None
+ self.main_template = main_template
+ self.dependant_templates = None
-class ThreatIntelligenceAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents Threat Intelligence alert rule template.
+class TemplateProperties(TemplateBaseProperties, TemplateAdditionalProperties):
+ """Template property bag.
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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar kind: The kind of the alert rule. Required. Known values are: "Scheduled",
- "MicrosoftSecurityIncidentCreation", "Fusion", "MLBehaviorAnalytics", "ThreatIntelligence", and
- "NRT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind
- :ivar alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
+ :ivar main_template: The JSON of the ARM template to deploy active content. Expandable.
+ :vartype main_template: JSON
+ :ivar dependant_templates: Dependant templates. Expandable.
+ :vartype dependant_templates: list[~azure.mgmt.securityinsight.models.TemplateProperties]
+ :ivar content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :vartype content_id: str
+ :ivar content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :vartype content_product_id: str
+ :ivar package_version: Version of the package. Default and recommended format is numeric (e.g.
+ 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but
+ then we cannot guarantee any version checks.
+ :vartype package_version: str
+ :ivar version: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0,
+ 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we
+ cannot guarantee any version checks.
+ :vartype version: str
+ :ivar display_name: The display name of the template.
:vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
- :ivar severity: The severity for alerts created by this alert rule. Known values are: "High",
- "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :ivar content_kind: The kind of content the template is for. Known values are: "DataConnector",
+ "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :vartype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :ivar source: Source of the content. This is where/how it was created.
+ :vartype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :ivar author: The creator of the content item.
+ :vartype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :ivar support: Support information for the template - type, name, contact information.
+ :vartype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :ivar dependencies: Dependencies for the content item, what other content items it requires to
+ work. Can describe more complex dependencies using a recursive/nested structure. For a single
+ dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :vartype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :ivar categories: Categories for the item.
+ :vartype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :ivar providers: Providers for the content item.
+ :vartype providers: list[str]
+ :ivar first_publish_date: first publish date content item.
+ :vartype first_publish_date: ~datetime.date
+ :ivar last_publish_date: last publish date for the content item.
+ :vartype last_publish_date: ~datetime.date
+ :ivar custom_version: The custom version of the content. A optional free text.
+ :vartype custom_version: str
+ :ivar content_schema_version: Schema version of the content. Can be used to distinguish between
+ different flow based on the schema version.
+ :vartype content_schema_version: str
+ :ivar icon: the icon identifier. this id can later be fetched from the content metadata.
+ :vartype icon: str
+ :ivar threat_analysis_tactics: the tactics the resource covers.
+ :vartype threat_analysis_tactics: list[str]
+ :ivar threat_analysis_techniques: the techniques the resource covers, these have to be aligned
+ with the tactics being used.
+ :vartype threat_analysis_techniques: list[str]
+ :ivar preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :vartype preview_images: list[str]
+ :ivar preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :vartype preview_images_dark: list[str]
+ :ivar package_id: the package Id contains this template.
+ :vartype package_id: str
+ :ivar package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :vartype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :ivar package_name: the name of the package contains this template.
+ :vartype package_name: str
+ :ivar is_deprecated: Flag indicates if this template is deprecated. Known values are: "true"
+ and "false".
+ :vartype is_deprecated: str or ~azure.mgmt.securityinsight.models.Flag
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ "dependant_templates": {"readonly": True},
+ "is_deprecated": {"readonly": True},
}
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
- "alert_rules_created_by_template_count": {"key": "properties.alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "properties.lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "properties.createdDateUTC", "type": "iso-8601"},
- "description": {"key": "properties.description", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "required_data_connectors": {
- "key": "properties.requiredDataConnectors",
- "type": "[AlertRuleTemplateDataSource]",
- },
- "status": {"key": "properties.status", "type": "str"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "type": "[str]"},
- "severity": {"key": "properties.severity", "type": "str"},
+ "main_template": {"key": "mainTemplate", "type": "object"},
+ "dependant_templates": {"key": "dependantTemplates", "type": "[TemplateProperties]"},
+ "content_id": {"key": "contentId", "type": "str"},
+ "content_product_id": {"key": "contentProductId", "type": "str"},
+ "package_version": {"key": "packageVersion", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "content_kind": {"key": "contentKind", "type": "str"},
+ "source": {"key": "source", "type": "MetadataSource"},
+ "author": {"key": "author", "type": "MetadataAuthor"},
+ "support": {"key": "support", "type": "MetadataSupport"},
+ "dependencies": {"key": "dependencies", "type": "MetadataDependencies"},
+ "categories": {"key": "categories", "type": "MetadataCategories"},
+ "providers": {"key": "providers", "type": "[str]"},
+ "first_publish_date": {"key": "firstPublishDate", "type": "date"},
+ "last_publish_date": {"key": "lastPublishDate", "type": "date"},
+ "custom_version": {"key": "customVersion", "type": "str"},
+ "content_schema_version": {"key": "contentSchemaVersion", "type": "str"},
+ "icon": {"key": "icon", "type": "str"},
+ "threat_analysis_tactics": {"key": "threatAnalysisTactics", "type": "[str]"},
+ "threat_analysis_techniques": {"key": "threatAnalysisTechniques", "type": "[str]"},
+ "preview_images": {"key": "previewImages", "type": "[str]"},
+ "preview_images_dark": {"key": "previewImagesDark", "type": "[str]"},
+ "package_id": {"key": "packageId", "type": "str"},
+ "package_kind": {"key": "packageKind", "type": "str"},
+ "package_name": {"key": "packageName", "type": "str"},
+ "is_deprecated": {"key": "isDeprecated", "type": "str"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
+ main_template: Optional[JSON] = None,
+ content_id: Optional[str] = None,
+ content_product_id: Optional[str] = None,
+ package_version: Optional[str] = None,
+ version: Optional[str] = None,
display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
+ content_kind: Optional[Union[str, "_models.Kind"]] = None,
+ source: Optional["_models.MetadataSource"] = None,
+ author: Optional["_models.MetadataAuthor"] = None,
+ support: Optional["_models.MetadataSupport"] = None,
+ dependencies: Optional["_models.MetadataDependencies"] = None,
+ categories: Optional["_models.MetadataCategories"] = None,
+ providers: Optional[List[str]] = None,
+ first_publish_date: Optional[datetime.date] = None,
+ last_publish_date: Optional[datetime.date] = None,
+ custom_version: Optional[str] = None,
+ content_schema_version: Optional[str] = None,
+ icon: Optional[str] = None,
+ threat_analysis_tactics: Optional[List[str]] = None,
+ threat_analysis_techniques: Optional[List[str]] = None,
+ preview_images: Optional[List[str]] = None,
+ preview_images_dark: Optional[List[str]] = None,
+ package_id: Optional[str] = None,
+ package_kind: Optional[Union[str, "_models.PackageKind"]] = None,
+ package_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword main_template: The JSON of the ARM template to deploy active content. Expandable.
+ :paramtype main_template: JSON
+ :keyword content_id: Static ID for the content. Used to identify dependencies and content from
+ solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic
+ for user-created. This is the resource name.
+ :paramtype content_id: str
+ :keyword content_product_id: Unique ID for the content. It should be generated based on the
+ contentId of the package, contentId of the template, contentKind of the template and the
+ contentVersion of the template.
+ :paramtype content_product_id: str
+ :keyword package_version: Version of the package. Default and recommended format is numeric
+ (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string,
+ but then we cannot guarantee any version checks.
+ :paramtype package_version: str
+ :keyword version: Version of the content. Default and recommended format is numeric (e.g. 1,
+ 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then
+ we cannot guarantee any version checks.
+ :paramtype version: str
+ :keyword display_name: The display name of the template.
:paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- :keyword severity: The severity for alerts created by this alert rule. Known values are:
- "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :keyword content_kind: The kind of content the template is for. Known values are:
+ "DataConnector", "DataType", "Workbook", "WorkbookTemplate", "Playbook", "PlaybookTemplate",
+ "AnalyticsRuleTemplate", "AnalyticsRule", "HuntingQuery", "InvestigationQuery", "Parser",
+ "Watchlist", "WatchlistTemplate", "Solution", "AzureFunction", "LogicAppsCustomConnector",
+ "AutomationRule", "ResourcesDataConnector", "Notebook", "Standalone", and "SummaryRule".
+ :paramtype content_kind: str or ~azure.mgmt.securityinsight.models.Kind
+ :keyword source: Source of the content. This is where/how it was created.
+ :paramtype source: ~azure.mgmt.securityinsight.models.MetadataSource
+ :keyword author: The creator of the content item.
+ :paramtype author: ~azure.mgmt.securityinsight.models.MetadataAuthor
+ :keyword support: Support information for the template - type, name, contact information.
+ :paramtype support: ~azure.mgmt.securityinsight.models.MetadataSupport
+ :keyword dependencies: Dependencies for the content item, what other content items it requires
+ to work. Can describe more complex dependencies using a recursive/nested structure. For a
+ single dependency an id/kind/version can be supplied or operator/criteria for complex formats.
+ :paramtype dependencies: ~azure.mgmt.securityinsight.models.MetadataDependencies
+ :keyword categories: Categories for the item.
+ :paramtype categories: ~azure.mgmt.securityinsight.models.MetadataCategories
+ :keyword providers: Providers for the content item.
+ :paramtype providers: list[str]
+ :keyword first_publish_date: first publish date content item.
+ :paramtype first_publish_date: ~datetime.date
+ :keyword last_publish_date: last publish date for the content item.
+ :paramtype last_publish_date: ~datetime.date
+ :keyword custom_version: The custom version of the content. A optional free text.
+ :paramtype custom_version: str
+ :keyword content_schema_version: Schema version of the content. Can be used to distinguish
+ between different flow based on the schema version.
+ :paramtype content_schema_version: str
+ :keyword icon: the icon identifier. this id can later be fetched from the content metadata.
+ :paramtype icon: str
+ :keyword threat_analysis_tactics: the tactics the resource covers.
+ :paramtype threat_analysis_tactics: list[str]
+ :keyword threat_analysis_techniques: the techniques the resource covers, these have to be
+ aligned with the tactics being used.
+ :paramtype threat_analysis_techniques: list[str]
+ :keyword preview_images: preview image file names. These will be taken from the solution
+ artifacts.
+ :paramtype preview_images: list[str]
+ :keyword preview_images_dark: preview image file names. These will be taken from the solution
+ artifacts. used for dark theme support.
+ :paramtype preview_images_dark: list[str]
+ :keyword package_id: the package Id contains this template.
+ :paramtype package_id: str
+ :keyword package_kind: the packageKind of the package contains this template. Known values are:
+ "Solution" and "Standalone".
+ :paramtype package_kind: str or ~azure.mgmt.securityinsight.models.PackageKind
+ :keyword package_name: the name of the package contains this template.
+ :paramtype package_name: str
"""
- super().__init__(**kwargs)
- self.kind: str = "ThreatIntelligence"
- self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
- self.last_updated_date_utc = None
- self.created_date_utc = None
- self.description = description
+ super().__init__(
+ content_id=content_id,
+ content_product_id=content_product_id,
+ package_version=package_version,
+ version=version,
+ display_name=display_name,
+ content_kind=content_kind,
+ source=source,
+ author=author,
+ support=support,
+ dependencies=dependencies,
+ categories=categories,
+ providers=providers,
+ first_publish_date=first_publish_date,
+ last_publish_date=last_publish_date,
+ custom_version=custom_version,
+ content_schema_version=content_schema_version,
+ icon=icon,
+ threat_analysis_tactics=threat_analysis_tactics,
+ threat_analysis_techniques=threat_analysis_techniques,
+ preview_images=preview_images,
+ preview_images_dark=preview_images_dark,
+ package_id=package_id,
+ package_kind=package_kind,
+ package_name=package_name,
+ main_template=main_template,
+ **kwargs
+ )
+ self.main_template = main_template
+ self.dependant_templates = None
+ self.content_id = content_id
+ self.content_product_id = content_product_id
+ self.package_version = package_version
+ self.version = version
self.display_name = display_name
- self.required_data_connectors = required_data_connectors
- self.status = status
- self.tactics = tactics
- self.techniques = techniques
- self.severity = severity
+ self.content_kind = content_kind
+ self.source = source
+ self.author = author
+ self.support = support
+ self.dependencies = dependencies
+ self.categories = categories
+ self.providers = providers
+ self.first_publish_date = first_publish_date
+ self.last_publish_date = last_publish_date
+ self.custom_version = custom_version
+ self.content_schema_version = content_schema_version
+ self.icon = icon
+ self.threat_analysis_tactics = threat_analysis_tactics
+ self.threat_analysis_techniques = threat_analysis_techniques
+ self.preview_images = preview_images
+ self.preview_images_dark = preview_images_dark
+ self.package_id = package_id
+ self.package_kind = package_kind
+ self.package_name = package_name
+ self.is_deprecated = None
-class ThreatIntelligenceAlertRuleTemplateProperties(AlertRuleTemplateWithMitreProperties):
- """Threat Intelligence alert rule template properties.
+class ThreatIntelligence(_serialization.Model):
+ """ThreatIntelligence property bag.
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 alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :vartype alert_rules_created_by_template_count: int
- :ivar last_updated_date_utc: The last time that this alert rule template has been updated.
- :vartype last_updated_date_utc: ~datetime.datetime
- :ivar created_date_utc: The time that this alert rule template has been added.
- :vartype created_date_utc: ~datetime.datetime
- :ivar description: The description of the alert rule template.
- :vartype description: str
- :ivar display_name: The display name for alert rule template.
- :vartype display_name: str
- :ivar required_data_connectors: The required data sources for this template.
- :vartype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :ivar status: The alert rule template status. Known values are: "Installed", "Available", and
- "NotAvailable".
- :vartype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :ivar tactics: The tactics of the alert rule.
- :vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :ivar techniques: The techniques of the alert rule.
- :vartype techniques: list[str]
- :ivar severity: The severity for alerts created by this alert rule. Required. Known values are:
- "High", "Medium", "Low", and "Informational".
- :vartype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
+ :ivar confidence: Confidence (must be between 0 and 1).
+ :vartype confidence: float
+ :ivar provider_name: Name of the provider from whom this Threat Intelligence information was
+ received.
+ :vartype provider_name: str
+ :ivar report_link: Report link.
+ :vartype report_link: str
+ :ivar threat_description: Threat description (free text).
+ :vartype threat_description: str
+ :ivar threat_name: Threat name (e.g. "Jedobot malware").
+ :vartype threat_name: str
+ :ivar threat_type: Threat type (e.g. "Botnet").
+ :vartype threat_type: str
"""
_validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
- "severity": {"required": True},
+ "confidence": {"readonly": True},
+ "provider_name": {"readonly": True},
+ "report_link": {"readonly": True},
+ "threat_description": {"readonly": True},
+ "threat_name": {"readonly": True},
+ "threat_type": {"readonly": True},
}
_attribute_map = {
- "alert_rules_created_by_template_count": {"key": "alertRulesCreatedByTemplateCount", "type": "int"},
- "last_updated_date_utc": {"key": "lastUpdatedDateUTC", "type": "iso-8601"},
- "created_date_utc": {"key": "createdDateUTC", "type": "iso-8601"},
- "description": {"key": "description", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "required_data_connectors": {"key": "requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
- "status": {"key": "status", "type": "str"},
- "tactics": {"key": "tactics", "type": "[str]"},
- "techniques": {"key": "techniques", "type": "[str]"},
- "severity": {"key": "severity", "type": "str"},
+ "confidence": {"key": "confidence", "type": "float"},
+ "provider_name": {"key": "providerName", "type": "str"},
+ "report_link": {"key": "reportLink", "type": "str"},
+ "threat_description": {"key": "threatDescription", "type": "str"},
+ "threat_name": {"key": "threatName", "type": "str"},
+ "threat_type": {"key": "threatType", "type": "str"},
}
- def __init__(
- self,
- *,
- severity: Union[str, "_models.AlertSeverity"],
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
- display_name: Optional[str] = None,
- required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
- status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
- techniques: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword alert_rules_created_by_template_count: the number of alert rules that were created by
- this template.
- :paramtype alert_rules_created_by_template_count: int
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
- :paramtype display_name: str
- :keyword required_data_connectors: The required data sources for this template.
- :paramtype required_data_connectors:
- list[~azure.mgmt.securityinsight.models.AlertRuleTemplateDataSource]
- :keyword status: The alert rule template status. Known values are: "Installed", "Available",
- and "NotAvailable".
- :paramtype status: str or ~azure.mgmt.securityinsight.models.TemplateStatus
- :keyword tactics: The tactics of the alert rule.
- :paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
- :keyword techniques: The techniques of the alert rule.
- :paramtype techniques: list[str]
- :keyword severity: The severity for alerts created by this alert rule. Required. Known values
- are: "High", "Medium", "Low", and "Informational".
- :paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
- """
- super().__init__(
- alert_rules_created_by_template_count=alert_rules_created_by_template_count,
- description=description,
- display_name=display_name,
- required_data_connectors=required_data_connectors,
- status=status,
- tactics=tactics,
- techniques=techniques,
- **kwargs
- )
- self.severity = severity
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.confidence = None
+ self.provider_name = None
+ self.report_link = None
+ self.threat_description = None
+ self.threat_name = None
+ self.threat_type = None
class ThreatIntelligenceAppendTags(_serialization.Model):
@@ -21331,7 +16415,7 @@ class ThreatIntelligenceAppendTags(_serialization.Model):
"threat_intelligence_tags": {"key": "threatIntelligenceTags", "type": "[str]"},
}
- def __init__(self, *, threat_intelligence_tags: Optional[List[str]] = None, **kwargs):
+ def __init__(self, *, threat_intelligence_tags: Optional[List[str]] = None, **kwargs: Any) -> None:
"""
:keyword threat_intelligence_tags: List of tags to be appended.
:paramtype threat_intelligence_tags: list[str]
@@ -21371,8 +16455,8 @@ def __init__(
source_name: Optional[str] = None,
url: Optional[str] = None,
hashes: Optional[Dict[str, str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword description: External reference description.
:paramtype description: str
@@ -21393,7 +16477,7 @@ def __init__(
self.hashes = hashes
-class ThreatIntelligenceFilteringCriteria(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ThreatIntelligenceFilteringCriteria(_serialization.Model):
"""Filtering criteria for querying threat intelligence indicators.
:ivar page_size: Page size.
@@ -21456,8 +16540,8 @@ def __init__(
ids: Optional[List[str]] = None,
keywords: Optional[List[str]] = None,
skip_token: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword page_size: Page size.
:paramtype page_size: int
@@ -21518,172 +16602,54 @@ class ThreatIntelligenceGranularMarkingModel(_serialization.Model):
"marking_ref": {"key": "markingRef", "type": "int"},
"selectors": {"key": "selectors", "type": "[str]"},
}
-
- def __init__(
- self,
- *,
- language: Optional[str] = None,
- marking_ref: Optional[int] = None,
- selectors: Optional[List[str]] = None,
- **kwargs
- ):
- """
- :keyword language: Language granular marking model.
- :paramtype language: str
- :keyword marking_ref: marking reference granular marking model.
- :paramtype marking_ref: int
- :keyword selectors: granular marking model selectors.
- :paramtype selectors: list[str]
- """
- super().__init__(**kwargs)
- self.language = language
- self.marking_ref = marking_ref
- self.selectors = selectors
-
-
-class ThreatIntelligenceInformation(ResourceWithEtag):
- """Threat intelligence information object.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- ThreatIntelligenceIndicatorModel
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the entity. Required. "indicator"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceResourceKindEnum
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- }
-
- _subtype_map = {"kind": {"indicator": "ThreatIntelligenceIndicatorModel"}}
-
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
-
-class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation): # pylint: disable=too-many-instance-attributes
- """Threat intelligence indicator entity.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the entity. Required. "indicator"
- :vartype kind: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceResourceKindEnum
- :ivar additional_data: A bag of custom fields that should be part of the entity and will be
- presented to the user.
- :vartype additional_data: dict[str, any]
- :ivar friendly_name: The graph item display name which is a short humanly readable description
- of the graph item instance. This property is optional and might be system generated.
- :vartype friendly_name: str
- :ivar threat_intelligence_tags: List of tags.
- :vartype threat_intelligence_tags: list[str]
- :ivar last_updated_time_utc: Last updated time in UTC.
- :vartype last_updated_time_utc: str
- :ivar source: Source of a threat intelligence entity.
- :vartype source: str
- :ivar display_name: Display name of a threat intelligence entity.
- :vartype display_name: str
- :ivar description: Description of a threat intelligence entity.
- :vartype description: str
- :ivar indicator_types: Indicator types of threat intelligence entities.
- :vartype indicator_types: list[str]
- :ivar pattern: Pattern of a threat intelligence entity.
- :vartype pattern: str
- :ivar pattern_type: Pattern type of a threat intelligence entity.
- :vartype pattern_type: str
- :ivar pattern_version: Pattern version of a threat intelligence entity.
- :vartype pattern_version: str
- :ivar kill_chain_phases: Kill chain phases.
- :vartype kill_chain_phases:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceKillChainPhase]
- :ivar parsed_pattern: Parsed patterns.
- :vartype parsed_pattern:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPattern]
- :ivar external_id: External ID of threat intelligence entity.
- :vartype external_id: str
- :ivar created_by_ref: Created by reference of threat intelligence entity.
- :vartype created_by_ref: str
- :ivar defanged: Is threat intelligence entity defanged.
- :vartype defanged: bool
- :ivar external_last_updated_time_utc: External last updated time in UTC.
- :vartype external_last_updated_time_utc: str
- :ivar external_references: External References.
- :vartype external_references:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceExternalReference]
- :ivar granular_markings: Granular Markings.
- :vartype granular_markings:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceGranularMarkingModel]
- :ivar labels: Labels of threat intelligence entity.
- :vartype labels: list[str]
- :ivar revoked: Is threat intelligence entity revoked.
- :vartype revoked: bool
- :ivar confidence: Confidence of threat intelligence entity.
- :vartype confidence: int
- :ivar object_marking_refs: Threat intelligence entity object marking references.
- :vartype object_marking_refs: list[str]
- :ivar language: Language of threat intelligence entity.
- :vartype language: str
- :ivar threat_types: Threat types.
- :vartype threat_types: list[str]
- :ivar valid_from: Valid from.
- :vartype valid_from: str
- :ivar valid_until: Valid until.
- :vartype valid_until: str
- :ivar created: Created by.
- :vartype created: str
- :ivar modified: Modified by.
- :vartype modified: str
- :ivar extensions: Extensions map.
- :vartype extensions: dict[str, any]
+
+ def __init__(
+ self,
+ *,
+ language: Optional[str] = None,
+ marking_ref: Optional[int] = None,
+ selectors: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword language: Language granular marking model.
+ :paramtype language: str
+ :keyword marking_ref: marking reference granular marking model.
+ :paramtype marking_ref: int
+ :keyword selectors: granular marking model selectors.
+ :paramtype selectors: list[str]
+ """
+ super().__init__(**kwargs)
+ self.language = language
+ self.marking_ref = marking_ref
+ self.selectors = selectors
+
+
+class ThreatIntelligenceInformation(ResourceWithEtag):
+ """Threat intelligence information object.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ ThreatIntelligenceIndicatorModel
+
+ 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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The kind of the entity. Required. "indicator"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceResourceInnerKind
"""
_validation = {
@@ -21692,8 +16658,6 @@ class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation): # pylint
"type": {"readonly": True},
"system_data": {"readonly": True},
"kind": {"required": True},
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
}
_attribute_map = {
@@ -21703,178 +16667,41 @@ class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation): # pylint
"system_data": {"key": "systemData", "type": "SystemData"},
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
- "additional_data": {"key": "properties.additionalData", "type": "{object}"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "threat_intelligence_tags": {"key": "properties.threatIntelligenceTags", "type": "[str]"},
- "last_updated_time_utc": {"key": "properties.lastUpdatedTimeUtc", "type": "str"},
- "source": {"key": "properties.source", "type": "str"},
- "display_name": {"key": "properties.displayName", "type": "str"},
- "description": {"key": "properties.description", "type": "str"},
- "indicator_types": {"key": "properties.indicatorTypes", "type": "[str]"},
- "pattern": {"key": "properties.pattern", "type": "str"},
- "pattern_type": {"key": "properties.patternType", "type": "str"},
- "pattern_version": {"key": "properties.patternVersion", "type": "str"},
- "kill_chain_phases": {"key": "properties.killChainPhases", "type": "[ThreatIntelligenceKillChainPhase]"},
- "parsed_pattern": {"key": "properties.parsedPattern", "type": "[ThreatIntelligenceParsedPattern]"},
- "external_id": {"key": "properties.externalId", "type": "str"},
- "created_by_ref": {"key": "properties.createdByRef", "type": "str"},
- "defanged": {"key": "properties.defanged", "type": "bool"},
- "external_last_updated_time_utc": {"key": "properties.externalLastUpdatedTimeUtc", "type": "str"},
- "external_references": {
- "key": "properties.externalReferences",
- "type": "[ThreatIntelligenceExternalReference]",
- },
- "granular_markings": {"key": "properties.granularMarkings", "type": "[ThreatIntelligenceGranularMarkingModel]"},
- "labels": {"key": "properties.labels", "type": "[str]"},
- "revoked": {"key": "properties.revoked", "type": "bool"},
- "confidence": {"key": "properties.confidence", "type": "int"},
- "object_marking_refs": {"key": "properties.objectMarkingRefs", "type": "[str]"},
- "language": {"key": "properties.language", "type": "str"},
- "threat_types": {"key": "properties.threatTypes", "type": "[str]"},
- "valid_from": {"key": "properties.validFrom", "type": "str"},
- "valid_until": {"key": "properties.validUntil", "type": "str"},
- "created": {"key": "properties.created", "type": "str"},
- "modified": {"key": "properties.modified", "type": "str"},
- "extensions": {"key": "properties.extensions", "type": "{object}"},
}
- def __init__( # pylint: disable=too-many-locals
- self,
- *,
- etag: Optional[str] = None,
- threat_intelligence_tags: Optional[List[str]] = None,
- last_updated_time_utc: Optional[str] = None,
- source: Optional[str] = None,
- display_name: Optional[str] = None,
- description: Optional[str] = None,
- indicator_types: Optional[List[str]] = None,
- pattern: Optional[str] = None,
- pattern_type: Optional[str] = None,
- pattern_version: Optional[str] = None,
- kill_chain_phases: Optional[List["_models.ThreatIntelligenceKillChainPhase"]] = None,
- parsed_pattern: Optional[List["_models.ThreatIntelligenceParsedPattern"]] = None,
- external_id: Optional[str] = None,
- created_by_ref: Optional[str] = None,
- defanged: Optional[bool] = None,
- external_last_updated_time_utc: Optional[str] = None,
- external_references: Optional[List["_models.ThreatIntelligenceExternalReference"]] = None,
- granular_markings: Optional[List["_models.ThreatIntelligenceGranularMarkingModel"]] = None,
- labels: Optional[List[str]] = None,
- revoked: Optional[bool] = None,
- confidence: Optional[int] = None,
- object_marking_refs: Optional[List[str]] = None,
- language: Optional[str] = None,
- threat_types: Optional[List[str]] = None,
- valid_from: Optional[str] = None,
- valid_until: Optional[str] = None,
- created: Optional[str] = None,
- modified: Optional[str] = None,
- extensions: Optional[Dict[str, Any]] = None,
- **kwargs
- ):
+ _subtype_map = {"kind": {"indicator": "ThreatIntelligenceIndicatorModel"}}
+
+ def __init__(self, *, etag: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
- :keyword threat_intelligence_tags: List of tags.
- :paramtype threat_intelligence_tags: list[str]
- :keyword last_updated_time_utc: Last updated time in UTC.
- :paramtype last_updated_time_utc: str
- :keyword source: Source of a threat intelligence entity.
- :paramtype source: str
- :keyword display_name: Display name of a threat intelligence entity.
- :paramtype display_name: str
- :keyword description: Description of a threat intelligence entity.
- :paramtype description: str
- :keyword indicator_types: Indicator types of threat intelligence entities.
- :paramtype indicator_types: list[str]
- :keyword pattern: Pattern of a threat intelligence entity.
- :paramtype pattern: str
- :keyword pattern_type: Pattern type of a threat intelligence entity.
- :paramtype pattern_type: str
- :keyword pattern_version: Pattern version of a threat intelligence entity.
- :paramtype pattern_version: str
- :keyword kill_chain_phases: Kill chain phases.
- :paramtype kill_chain_phases:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceKillChainPhase]
- :keyword parsed_pattern: Parsed patterns.
- :paramtype parsed_pattern:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPattern]
- :keyword external_id: External ID of threat intelligence entity.
- :paramtype external_id: str
- :keyword created_by_ref: Created by reference of threat intelligence entity.
- :paramtype created_by_ref: str
- :keyword defanged: Is threat intelligence entity defanged.
- :paramtype defanged: bool
- :keyword external_last_updated_time_utc: External last updated time in UTC.
- :paramtype external_last_updated_time_utc: str
- :keyword external_references: External References.
- :paramtype external_references:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceExternalReference]
- :keyword granular_markings: Granular Markings.
- :paramtype granular_markings:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceGranularMarkingModel]
- :keyword labels: Labels of threat intelligence entity.
- :paramtype labels: list[str]
- :keyword revoked: Is threat intelligence entity revoked.
- :paramtype revoked: bool
- :keyword confidence: Confidence of threat intelligence entity.
- :paramtype confidence: int
- :keyword object_marking_refs: Threat intelligence entity object marking references.
- :paramtype object_marking_refs: list[str]
- :keyword language: Language of threat intelligence entity.
- :paramtype language: str
- :keyword threat_types: Threat types.
- :paramtype threat_types: list[str]
- :keyword valid_from: Valid from.
- :paramtype valid_from: str
- :keyword valid_until: Valid until.
- :paramtype valid_until: str
- :keyword created: Created by.
- :paramtype created: str
- :keyword modified: Modified by.
- :paramtype modified: str
- :keyword extensions: Extensions map.
- :paramtype extensions: dict[str, any]
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "indicator"
- self.additional_data = None
- self.friendly_name = None
- self.threat_intelligence_tags = threat_intelligence_tags
- self.last_updated_time_utc = last_updated_time_utc
- self.source = source
- self.display_name = display_name
- self.description = description
- self.indicator_types = indicator_types
- self.pattern = pattern
- self.pattern_type = pattern_type
- self.pattern_version = pattern_version
- self.kill_chain_phases = kill_chain_phases
- self.parsed_pattern = parsed_pattern
- self.external_id = external_id
- self.created_by_ref = created_by_ref
- self.defanged = defanged
- self.external_last_updated_time_utc = external_last_updated_time_utc
- self.external_references = external_references
- self.granular_markings = granular_markings
- self.labels = labels
- self.revoked = revoked
- self.confidence = confidence
- self.object_marking_refs = object_marking_refs
- self.language = language
- self.threat_types = threat_types
- self.valid_from = valid_from
- self.valid_until = valid_until
- self.created = created
- self.modified = modified
- self.extensions = extensions
+ self.kind: Optional[str] = None
-class ThreatIntelligenceIndicatorProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Describes threat intelligence entity properties.
+class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation):
+ """Threat intelligence indicator entity.
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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :vartype id: str
+ :ivar name: The name of the resource.
+ :vartype name: str
+ :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
+ "Microsoft.Storage/storageAccounts".
+ :vartype type: str
+ :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar kind: The kind of the entity. Required. "indicator"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceResourceInnerKind
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -21944,46 +16771,61 @@ class ThreatIntelligenceIndicatorProperties(EntityCommonProperties): # pylint:
"""
_validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "kind": {"required": True},
"additional_data": {"readonly": True},
"friendly_name": {"readonly": True},
}
_attribute_map = {
- "additional_data": {"key": "additionalData", "type": "{object}"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "threat_intelligence_tags": {"key": "threatIntelligenceTags", "type": "[str]"},
- "last_updated_time_utc": {"key": "lastUpdatedTimeUtc", "type": "str"},
- "source": {"key": "source", "type": "str"},
- "display_name": {"key": "displayName", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "indicator_types": {"key": "indicatorTypes", "type": "[str]"},
- "pattern": {"key": "pattern", "type": "str"},
- "pattern_type": {"key": "patternType", "type": "str"},
- "pattern_version": {"key": "patternVersion", "type": "str"},
- "kill_chain_phases": {"key": "killChainPhases", "type": "[ThreatIntelligenceKillChainPhase]"},
- "parsed_pattern": {"key": "parsedPattern", "type": "[ThreatIntelligenceParsedPattern]"},
- "external_id": {"key": "externalId", "type": "str"},
- "created_by_ref": {"key": "createdByRef", "type": "str"},
- "defanged": {"key": "defanged", "type": "bool"},
- "external_last_updated_time_utc": {"key": "externalLastUpdatedTimeUtc", "type": "str"},
- "external_references": {"key": "externalReferences", "type": "[ThreatIntelligenceExternalReference]"},
- "granular_markings": {"key": "granularMarkings", "type": "[ThreatIntelligenceGranularMarkingModel]"},
- "labels": {"key": "labels", "type": "[str]"},
- "revoked": {"key": "revoked", "type": "bool"},
- "confidence": {"key": "confidence", "type": "int"},
- "object_marking_refs": {"key": "objectMarkingRefs", "type": "[str]"},
- "language": {"key": "language", "type": "str"},
- "threat_types": {"key": "threatTypes", "type": "[str]"},
- "valid_from": {"key": "validFrom", "type": "str"},
- "valid_until": {"key": "validUntil", "type": "str"},
- "created": {"key": "created", "type": "str"},
- "modified": {"key": "modified", "type": "str"},
- "extensions": {"key": "extensions", "type": "{object}"},
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "etag": {"key": "etag", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "additional_data": {"key": "properties.additionalData", "type": "{object}"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "threat_intelligence_tags": {"key": "properties.threatIntelligenceTags", "type": "[str]"},
+ "last_updated_time_utc": {"key": "properties.lastUpdatedTimeUtc", "type": "str"},
+ "source": {"key": "properties.source", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "indicator_types": {"key": "properties.indicatorTypes", "type": "[str]"},
+ "pattern": {"key": "properties.pattern", "type": "str"},
+ "pattern_type": {"key": "properties.patternType", "type": "str"},
+ "pattern_version": {"key": "properties.patternVersion", "type": "str"},
+ "kill_chain_phases": {"key": "properties.killChainPhases", "type": "[ThreatIntelligenceKillChainPhase]"},
+ "parsed_pattern": {"key": "properties.parsedPattern", "type": "[ThreatIntelligenceParsedPattern]"},
+ "external_id": {"key": "properties.externalId", "type": "str"},
+ "created_by_ref": {"key": "properties.createdByRef", "type": "str"},
+ "defanged": {"key": "properties.defanged", "type": "bool"},
+ "external_last_updated_time_utc": {"key": "properties.externalLastUpdatedTimeUtc", "type": "str"},
+ "external_references": {
+ "key": "properties.externalReferences",
+ "type": "[ThreatIntelligenceExternalReference]",
+ },
+ "granular_markings": {"key": "properties.granularMarkings", "type": "[ThreatIntelligenceGranularMarkingModel]"},
+ "labels": {"key": "properties.labels", "type": "[str]"},
+ "revoked": {"key": "properties.revoked", "type": "bool"},
+ "confidence": {"key": "properties.confidence", "type": "int"},
+ "object_marking_refs": {"key": "properties.objectMarkingRefs", "type": "[str]"},
+ "language": {"key": "properties.language", "type": "str"},
+ "threat_types": {"key": "properties.threatTypes", "type": "[str]"},
+ "valid_from": {"key": "properties.validFrom", "type": "str"},
+ "valid_until": {"key": "properties.validUntil", "type": "str"},
+ "created": {"key": "properties.created", "type": "str"},
+ "modified": {"key": "properties.modified", "type": "str"},
+ "extensions": {"key": "properties.extensions", "type": "{object}"},
}
def __init__( # pylint: disable=too-many-locals
self,
*,
+ etag: Optional[str] = None,
threat_intelligence_tags: Optional[List[str]] = None,
last_updated_time_utc: Optional[str] = None,
source: Optional[str] = None,
@@ -22012,9 +16854,11 @@ def __init__( # pylint: disable=too-many-locals
created: Optional[str] = None,
modified: Optional[str] = None,
extensions: Optional[Dict[str, Any]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
:keyword threat_intelligence_tags: List of tags.
:paramtype threat_intelligence_tags: list[str]
:keyword last_updated_time_utc: Last updated time in UTC.
@@ -22076,7 +16920,10 @@ def __init__( # pylint: disable=too-many-locals
:keyword extensions: Extensions map.
:paramtype extensions: dict[str, any]
"""
- super().__init__(**kwargs)
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = "indicator"
+ self.additional_data = None
+ self.friendly_name = None
self.threat_intelligence_tags = threat_intelligence_tags
self.last_updated_time_utc = last_updated_time_utc
self.source = source
@@ -22099,733 +16946,539 @@ def __init__( # pylint: disable=too-many-locals
self.confidence = confidence
self.object_marking_refs = object_marking_refs
self.language = language
- self.threat_types = threat_types
- self.valid_from = valid_from
- self.valid_until = valid_until
- self.created = created
- self.modified = modified
- self.extensions = extensions
-
-
-class ThreatIntelligenceInformationList(_serialization.Model):
- """List of all the threat intelligence information objects.
-
- 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 next_link: URL to fetch the next set of information objects.
- :vartype next_link: str
- :ivar value: Array of threat intelligence information objects. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation]
- """
-
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
- _attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[ThreatIntelligenceInformation]"},
- }
-
- def __init__(self, *, value: List["_models.ThreatIntelligenceInformation"], **kwargs):
- """
- :keyword value: Array of threat intelligence information objects. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class ThreatIntelligenceKillChainPhase(_serialization.Model):
- """Describes threat kill chain phase entity.
-
- :ivar kill_chain_name: Kill chainName name.
- :vartype kill_chain_name: str
- :ivar phase_name: Phase name.
- :vartype phase_name: str
- """
-
- _attribute_map = {
- "kill_chain_name": {"key": "killChainName", "type": "str"},
- "phase_name": {"key": "phaseName", "type": "str"},
- }
-
- def __init__(self, *, kill_chain_name: Optional[str] = None, phase_name: Optional[str] = None, **kwargs):
- """
- :keyword kill_chain_name: Kill chainName name.
- :paramtype kill_chain_name: str
- :keyword phase_name: Phase name.
- :paramtype phase_name: str
- """
- super().__init__(**kwargs)
- self.kill_chain_name = kill_chain_name
- self.phase_name = phase_name
-
-
-class ThreatIntelligenceMetric(_serialization.Model):
- """Describes threat intelligence metric.
-
- :ivar last_updated_time_utc: Last updated indicator metric.
- :vartype last_updated_time_utc: str
- :ivar threat_type_metrics: Threat type metrics.
- :vartype threat_type_metrics:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
- :ivar pattern_type_metrics: Pattern type metrics.
- :vartype pattern_type_metrics:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
- :ivar source_metrics: Source metrics.
- :vartype source_metrics:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
- """
-
- _attribute_map = {
- "last_updated_time_utc": {"key": "lastUpdatedTimeUtc", "type": "str"},
- "threat_type_metrics": {"key": "threatTypeMetrics", "type": "[ThreatIntelligenceMetricEntity]"},
- "pattern_type_metrics": {"key": "patternTypeMetrics", "type": "[ThreatIntelligenceMetricEntity]"},
- "source_metrics": {"key": "sourceMetrics", "type": "[ThreatIntelligenceMetricEntity]"},
- }
-
- def __init__(
- self,
- *,
- last_updated_time_utc: Optional[str] = None,
- threat_type_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
- pattern_type_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
- source_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
- **kwargs
- ):
- """
- :keyword last_updated_time_utc: Last updated indicator metric.
- :paramtype last_updated_time_utc: str
- :keyword threat_type_metrics: Threat type metrics.
- :paramtype threat_type_metrics:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
- :keyword pattern_type_metrics: Pattern type metrics.
- :paramtype pattern_type_metrics:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
- :keyword source_metrics: Source metrics.
- :paramtype source_metrics:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
- """
- super().__init__(**kwargs)
- self.last_updated_time_utc = last_updated_time_utc
- self.threat_type_metrics = threat_type_metrics
- self.pattern_type_metrics = pattern_type_metrics
- self.source_metrics = source_metrics
-
-
-class ThreatIntelligenceMetricEntity(_serialization.Model):
- """Describes threat intelligence metric entity.
-
- :ivar metric_name: Metric name.
- :vartype metric_name: str
- :ivar metric_value: Metric value.
- :vartype metric_value: int
- """
-
- _attribute_map = {
- "metric_name": {"key": "metricName", "type": "str"},
- "metric_value": {"key": "metricValue", "type": "int"},
- }
-
- def __init__(self, *, metric_name: Optional[str] = None, metric_value: Optional[int] = None, **kwargs):
- """
- :keyword metric_name: Metric name.
- :paramtype metric_name: str
- :keyword metric_value: Metric value.
- :paramtype metric_value: int
- """
- super().__init__(**kwargs)
- self.metric_name = metric_name
- self.metric_value = metric_value
-
-
-class ThreatIntelligenceMetrics(_serialization.Model):
- """Threat intelligence metrics.
-
- :ivar properties: Threat intelligence metrics.
- :vartype properties: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetric
- """
-
- _attribute_map = {
- "properties": {"key": "properties", "type": "ThreatIntelligenceMetric"},
- }
-
- def __init__(self, *, properties: Optional["_models.ThreatIntelligenceMetric"] = None, **kwargs):
- """
- :keyword properties: Threat intelligence metrics.
- :paramtype properties: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetric
- """
- super().__init__(**kwargs)
- self.properties = properties
-
-
-class ThreatIntelligenceMetricsList(_serialization.Model):
- """List of all the threat intelligence metric fields (type/threat type/source).
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar value: Array of threat intelligence metric fields (type/threat type/source). Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetrics]
- """
-
- _validation = {
- "value": {"required": True},
- }
-
- _attribute_map = {
- "value": {"key": "value", "type": "[ThreatIntelligenceMetrics]"},
- }
-
- def __init__(self, *, value: List["_models.ThreatIntelligenceMetrics"], **kwargs):
- """
- :keyword value: Array of threat intelligence metric fields (type/threat type/source). Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetrics]
- """
- super().__init__(**kwargs)
- self.value = value
-
-
-class ThreatIntelligenceParsedPattern(_serialization.Model):
- """Describes parsed pattern entity.
-
- :ivar pattern_type_key: Pattern type key.
- :vartype pattern_type_key: str
- :ivar pattern_type_values: Pattern type keys.
- :vartype pattern_type_values:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPatternTypeValue]
- """
-
- _attribute_map = {
- "pattern_type_key": {"key": "patternTypeKey", "type": "str"},
- "pattern_type_values": {"key": "patternTypeValues", "type": "[ThreatIntelligenceParsedPatternTypeValue]"},
- }
-
- def __init__(
- self,
- *,
- pattern_type_key: Optional[str] = None,
- pattern_type_values: Optional[List["_models.ThreatIntelligenceParsedPatternTypeValue"]] = None,
- **kwargs
- ):
- """
- :keyword pattern_type_key: Pattern type key.
- :paramtype pattern_type_key: str
- :keyword pattern_type_values: Pattern type keys.
- :paramtype pattern_type_values:
- list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPatternTypeValue]
- """
- super().__init__(**kwargs)
- self.pattern_type_key = pattern_type_key
- self.pattern_type_values = pattern_type_values
+ self.threat_types = threat_types
+ self.valid_from = valid_from
+ self.valid_until = valid_until
+ self.created = created
+ self.modified = modified
+ self.extensions = extensions
-class ThreatIntelligenceParsedPatternTypeValue(_serialization.Model):
- """Describes threat kill chain phase entity.
+class ThreatIntelligenceIndicatorProperties(EntityCommonProperties):
+ """Describes threat intelligence entity properties.
- :ivar value_type: Type of the value.
- :vartype value_type: str
- :ivar value: Value of parsed pattern.
- :vartype value: str
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar additional_data: A bag of custom fields that should be part of the entity and will be
+ presented to the user.
+ :vartype additional_data: dict[str, any]
+ :ivar friendly_name: The graph item display name which is a short humanly readable description
+ of the graph item instance. This property is optional and might be system generated.
+ :vartype friendly_name: str
+ :ivar threat_intelligence_tags: List of tags.
+ :vartype threat_intelligence_tags: list[str]
+ :ivar last_updated_time_utc: Last updated time in UTC.
+ :vartype last_updated_time_utc: str
+ :ivar source: Source of a threat intelligence entity.
+ :vartype source: str
+ :ivar display_name: Display name of a threat intelligence entity.
+ :vartype display_name: str
+ :ivar description: Description of a threat intelligence entity.
+ :vartype description: str
+ :ivar indicator_types: Indicator types of threat intelligence entities.
+ :vartype indicator_types: list[str]
+ :ivar pattern: Pattern of a threat intelligence entity.
+ :vartype pattern: str
+ :ivar pattern_type: Pattern type of a threat intelligence entity.
+ :vartype pattern_type: str
+ :ivar pattern_version: Pattern version of a threat intelligence entity.
+ :vartype pattern_version: str
+ :ivar kill_chain_phases: Kill chain phases.
+ :vartype kill_chain_phases:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceKillChainPhase]
+ :ivar parsed_pattern: Parsed patterns.
+ :vartype parsed_pattern:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPattern]
+ :ivar external_id: External ID of threat intelligence entity.
+ :vartype external_id: str
+ :ivar created_by_ref: Created by reference of threat intelligence entity.
+ :vartype created_by_ref: str
+ :ivar defanged: Is threat intelligence entity defanged.
+ :vartype defanged: bool
+ :ivar external_last_updated_time_utc: External last updated time in UTC.
+ :vartype external_last_updated_time_utc: str
+ :ivar external_references: External References.
+ :vartype external_references:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceExternalReference]
+ :ivar granular_markings: Granular Markings.
+ :vartype granular_markings:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceGranularMarkingModel]
+ :ivar labels: Labels of threat intelligence entity.
+ :vartype labels: list[str]
+ :ivar revoked: Is threat intelligence entity revoked.
+ :vartype revoked: bool
+ :ivar confidence: Confidence of threat intelligence entity.
+ :vartype confidence: int
+ :ivar object_marking_refs: Threat intelligence entity object marking references.
+ :vartype object_marking_refs: list[str]
+ :ivar language: Language of threat intelligence entity.
+ :vartype language: str
+ :ivar threat_types: Threat types.
+ :vartype threat_types: list[str]
+ :ivar valid_from: Valid from.
+ :vartype valid_from: str
+ :ivar valid_until: Valid until.
+ :vartype valid_until: str
+ :ivar created: Created by.
+ :vartype created: str
+ :ivar modified: Modified by.
+ :vartype modified: str
+ :ivar extensions: Extensions map.
+ :vartype extensions: dict[str, any]
"""
- _attribute_map = {
- "value_type": {"key": "valueType", "type": "str"},
- "value": {"key": "value", "type": "str"},
+ _validation = {
+ "additional_data": {"readonly": True},
+ "friendly_name": {"readonly": True},
}
- def __init__(self, *, value_type: Optional[str] = None, value: Optional[str] = None, **kwargs):
- """
- :keyword value_type: Type of the value.
- :paramtype value_type: str
- :keyword value: Value of parsed pattern.
- :paramtype value: str
- """
- super().__init__(**kwargs)
- self.value_type = value_type
- self.value = value
-
-
-class ThreatIntelligenceSortingCriteria(_serialization.Model):
- """List of available columns for sorting.
-
- :ivar item_key: Column name.
- :vartype item_key: str
- :ivar sort_order: Sorting order (ascending/descending/unsorted). Known values are: "unsorted",
- "ascending", and "descending".
- :vartype sort_order: str or
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceSortingCriteriaEnum
- """
-
_attribute_map = {
- "item_key": {"key": "itemKey", "type": "str"},
- "sort_order": {"key": "sortOrder", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "threat_intelligence_tags": {"key": "threatIntelligenceTags", "type": "[str]"},
+ "last_updated_time_utc": {"key": "lastUpdatedTimeUtc", "type": "str"},
+ "source": {"key": "source", "type": "str"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "indicator_types": {"key": "indicatorTypes", "type": "[str]"},
+ "pattern": {"key": "pattern", "type": "str"},
+ "pattern_type": {"key": "patternType", "type": "str"},
+ "pattern_version": {"key": "patternVersion", "type": "str"},
+ "kill_chain_phases": {"key": "killChainPhases", "type": "[ThreatIntelligenceKillChainPhase]"},
+ "parsed_pattern": {"key": "parsedPattern", "type": "[ThreatIntelligenceParsedPattern]"},
+ "external_id": {"key": "externalId", "type": "str"},
+ "created_by_ref": {"key": "createdByRef", "type": "str"},
+ "defanged": {"key": "defanged", "type": "bool"},
+ "external_last_updated_time_utc": {"key": "externalLastUpdatedTimeUtc", "type": "str"},
+ "external_references": {"key": "externalReferences", "type": "[ThreatIntelligenceExternalReference]"},
+ "granular_markings": {"key": "granularMarkings", "type": "[ThreatIntelligenceGranularMarkingModel]"},
+ "labels": {"key": "labels", "type": "[str]"},
+ "revoked": {"key": "revoked", "type": "bool"},
+ "confidence": {"key": "confidence", "type": "int"},
+ "object_marking_refs": {"key": "objectMarkingRefs", "type": "[str]"},
+ "language": {"key": "language", "type": "str"},
+ "threat_types": {"key": "threatTypes", "type": "[str]"},
+ "valid_from": {"key": "validFrom", "type": "str"},
+ "valid_until": {"key": "validUntil", "type": "str"},
+ "created": {"key": "created", "type": "str"},
+ "modified": {"key": "modified", "type": "str"},
+ "extensions": {"key": "extensions", "type": "{object}"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
- item_key: Optional[str] = None,
- sort_order: Optional[Union[str, "_models.ThreatIntelligenceSortingCriteriaEnum"]] = None,
- **kwargs
- ):
+ threat_intelligence_tags: Optional[List[str]] = None,
+ last_updated_time_utc: Optional[str] = None,
+ source: Optional[str] = None,
+ display_name: Optional[str] = None,
+ description: Optional[str] = None,
+ indicator_types: Optional[List[str]] = None,
+ pattern: Optional[str] = None,
+ pattern_type: Optional[str] = None,
+ pattern_version: Optional[str] = None,
+ kill_chain_phases: Optional[List["_models.ThreatIntelligenceKillChainPhase"]] = None,
+ parsed_pattern: Optional[List["_models.ThreatIntelligenceParsedPattern"]] = None,
+ external_id: Optional[str] = None,
+ created_by_ref: Optional[str] = None,
+ defanged: Optional[bool] = None,
+ external_last_updated_time_utc: Optional[str] = None,
+ external_references: Optional[List["_models.ThreatIntelligenceExternalReference"]] = None,
+ granular_markings: Optional[List["_models.ThreatIntelligenceGranularMarkingModel"]] = None,
+ labels: Optional[List[str]] = None,
+ revoked: Optional[bool] = None,
+ confidence: Optional[int] = None,
+ object_marking_refs: Optional[List[str]] = None,
+ language: Optional[str] = None,
+ threat_types: Optional[List[str]] = None,
+ valid_from: Optional[str] = None,
+ valid_until: Optional[str] = None,
+ created: Optional[str] = None,
+ modified: Optional[str] = None,
+ extensions: Optional[Dict[str, Any]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword item_key: Column name.
- :paramtype item_key: str
- :keyword sort_order: Sorting order (ascending/descending/unsorted). Known values are:
- "unsorted", "ascending", and "descending".
- :paramtype sort_order: str or
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceSortingCriteriaEnum
+ :keyword threat_intelligence_tags: List of tags.
+ :paramtype threat_intelligence_tags: list[str]
+ :keyword last_updated_time_utc: Last updated time in UTC.
+ :paramtype last_updated_time_utc: str
+ :keyword source: Source of a threat intelligence entity.
+ :paramtype source: str
+ :keyword display_name: Display name of a threat intelligence entity.
+ :paramtype display_name: str
+ :keyword description: Description of a threat intelligence entity.
+ :paramtype description: str
+ :keyword indicator_types: Indicator types of threat intelligence entities.
+ :paramtype indicator_types: list[str]
+ :keyword pattern: Pattern of a threat intelligence entity.
+ :paramtype pattern: str
+ :keyword pattern_type: Pattern type of a threat intelligence entity.
+ :paramtype pattern_type: str
+ :keyword pattern_version: Pattern version of a threat intelligence entity.
+ :paramtype pattern_version: str
+ :keyword kill_chain_phases: Kill chain phases.
+ :paramtype kill_chain_phases:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceKillChainPhase]
+ :keyword parsed_pattern: Parsed patterns.
+ :paramtype parsed_pattern:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPattern]
+ :keyword external_id: External ID of threat intelligence entity.
+ :paramtype external_id: str
+ :keyword created_by_ref: Created by reference of threat intelligence entity.
+ :paramtype created_by_ref: str
+ :keyword defanged: Is threat intelligence entity defanged.
+ :paramtype defanged: bool
+ :keyword external_last_updated_time_utc: External last updated time in UTC.
+ :paramtype external_last_updated_time_utc: str
+ :keyword external_references: External References.
+ :paramtype external_references:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceExternalReference]
+ :keyword granular_markings: Granular Markings.
+ :paramtype granular_markings:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceGranularMarkingModel]
+ :keyword labels: Labels of threat intelligence entity.
+ :paramtype labels: list[str]
+ :keyword revoked: Is threat intelligence entity revoked.
+ :paramtype revoked: bool
+ :keyword confidence: Confidence of threat intelligence entity.
+ :paramtype confidence: int
+ :keyword object_marking_refs: Threat intelligence entity object marking references.
+ :paramtype object_marking_refs: list[str]
+ :keyword language: Language of threat intelligence entity.
+ :paramtype language: str
+ :keyword threat_types: Threat types.
+ :paramtype threat_types: list[str]
+ :keyword valid_from: Valid from.
+ :paramtype valid_from: str
+ :keyword valid_until: Valid until.
+ :paramtype valid_until: str
+ :keyword created: Created by.
+ :paramtype created: str
+ :keyword modified: Modified by.
+ :paramtype modified: str
+ :keyword extensions: Extensions map.
+ :paramtype extensions: dict[str, any]
"""
super().__init__(**kwargs)
- self.item_key = item_key
- self.sort_order = sort_order
+ self.threat_intelligence_tags = threat_intelligence_tags
+ self.last_updated_time_utc = last_updated_time_utc
+ self.source = source
+ self.display_name = display_name
+ self.description = description
+ self.indicator_types = indicator_types
+ self.pattern = pattern
+ self.pattern_type = pattern_type
+ self.pattern_version = pattern_version
+ self.kill_chain_phases = kill_chain_phases
+ self.parsed_pattern = parsed_pattern
+ self.external_id = external_id
+ self.created_by_ref = created_by_ref
+ self.defanged = defanged
+ self.external_last_updated_time_utc = external_last_updated_time_utc
+ self.external_references = external_references
+ self.granular_markings = granular_markings
+ self.labels = labels
+ self.revoked = revoked
+ self.confidence = confidence
+ self.object_marking_refs = object_marking_refs
+ self.language = language
+ self.threat_types = threat_types
+ self.valid_from = valid_from
+ self.valid_until = valid_until
+ self.created = created
+ self.modified = modified
+ self.extensions = extensions
-class TICheckRequirements(DataConnectorsCheckRequirements):
- """Threat Intelligence Platforms data connector check requirements.
+class ThreatIntelligenceInformationList(_serialization.Model):
+ """List of all the threat intelligence information objects.
- All required parameters must be populated in order to send to Azure.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar next_link: URL to fetch the next set of information objects.
+ :vartype next_link: str
+ :ivar value: Array of threat intelligence information objects. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation]
"""
_validation = {
- "kind": {"required": True},
+ "next_link": {"readonly": True},
+ "value": {"required": True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[ThreatIntelligenceInformation]"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(self, *, value: List["_models.ThreatIntelligenceInformation"], **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword value: Array of threat intelligence information objects. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation]
"""
super().__init__(**kwargs)
- self.kind: str = "ThreatIntelligence"
- self.tenant_id = tenant_id
-
+ self.next_link = None
+ self.value = value
-class TICheckRequirementsProperties(DataConnectorTenantId):
- """Threat Intelligence Platforms data connector required properties.
- All required parameters must be populated in order to send to Azure.
+class ThreatIntelligenceKillChainPhase(_serialization.Model):
+ """Describes threat kill chain phase entity.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
+ :ivar kill_chain_name: Kill chainName name.
+ :vartype kill_chain_name: str
+ :ivar phase_name: Phase name.
+ :vartype phase_name: str
"""
- _validation = {
- "tenant_id": {"required": True},
- }
-
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "kill_chain_name": {"key": "killChainName", "type": "str"},
+ "phase_name": {"key": "phaseName", "type": "str"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self, *, kill_chain_name: Optional[str] = None, phase_name: Optional[str] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword kill_chain_name: Kill chainName name.
+ :paramtype kill_chain_name: str
+ :keyword phase_name: Phase name.
+ :paramtype phase_name: str
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
-
-
-class TIDataConnector(DataConnector):
- """Represents threat intelligence data connector.
+ super().__init__(**kwargs)
+ self.kill_chain_name = kill_chain_name
+ self.phase_name = phase_name
- 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.
+class ThreatIntelligenceMetric(_serialization.Model):
+ """Describes threat intelligence metric.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
- "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
- :ivar tip_lookback_period: The lookback period for the feed to be imported.
- :vartype tip_lookback_period: ~datetime.datetime
- :ivar data_types: The available data types for the connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
+ :ivar last_updated_time_utc: Last updated indicator metric.
+ :vartype last_updated_time_utc: str
+ :ivar threat_type_metrics: Threat type metrics.
+ :vartype threat_type_metrics:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
+ :ivar pattern_type_metrics: Pattern type metrics.
+ :vartype pattern_type_metrics:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
+ :ivar source_metrics: Source metrics.
+ :vartype source_metrics:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
"""
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
_attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "tip_lookback_period": {"key": "properties.tipLookbackPeriod", "type": "iso-8601"},
- "data_types": {"key": "properties.dataTypes", "type": "TIDataConnectorDataTypes"},
+ "last_updated_time_utc": {"key": "lastUpdatedTimeUtc", "type": "str"},
+ "threat_type_metrics": {"key": "threatTypeMetrics", "type": "[ThreatIntelligenceMetricEntity]"},
+ "pattern_type_metrics": {"key": "patternTypeMetrics", "type": "[ThreatIntelligenceMetricEntity]"},
+ "source_metrics": {"key": "sourceMetrics", "type": "[ThreatIntelligenceMetricEntity]"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- tip_lookback_period: Optional[datetime.datetime] = None,
- data_types: Optional["_models.TIDataConnectorDataTypes"] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
- :keyword tip_lookback_period: The lookback period for the feed to be imported.
- :paramtype tip_lookback_period: ~datetime.datetime
- :keyword data_types: The available data types for the connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "ThreatIntelligence"
- self.tenant_id = tenant_id
- self.tip_lookback_period = tip_lookback_period
- self.data_types = data_types
-
-
-class TIDataConnectorDataTypes(_serialization.Model):
- """The available data types for TI (Threat Intelligence) data connector.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar indicators: Data type for indicators connection. Required.
- :vartype indicators: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators
- """
-
- _validation = {
- "indicators": {"required": True},
- }
-
- _attribute_map = {
- "indicators": {"key": "indicators", "type": "TIDataConnectorDataTypesIndicators"},
- }
-
- def __init__(self, *, indicators: "_models.TIDataConnectorDataTypesIndicators", **kwargs):
+ last_updated_time_utc: Optional[str] = None,
+ threat_type_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
+ pattern_type_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
+ source_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword indicators: Data type for indicators connection. Required.
- :paramtype indicators: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators
+ :keyword last_updated_time_utc: Last updated indicator metric.
+ :paramtype last_updated_time_utc: str
+ :keyword threat_type_metrics: Threat type metrics.
+ :paramtype threat_type_metrics:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
+ :keyword pattern_type_metrics: Pattern type metrics.
+ :paramtype pattern_type_metrics:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
+ :keyword source_metrics: Source metrics.
+ :paramtype source_metrics:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricEntity]
"""
super().__init__(**kwargs)
- self.indicators = indicators
-
-
-class TIDataConnectorDataTypesIndicators(DataConnectorDataTypeCommon):
- """Data type for indicators connection.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
-
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
- super().__init__(state=state, **kwargs)
-
+ self.last_updated_time_utc = last_updated_time_utc
+ self.threat_type_metrics = threat_type_metrics
+ self.pattern_type_metrics = pattern_type_metrics
+ self.source_metrics = source_metrics
-class TIDataConnectorProperties(DataConnectorTenantId):
- """TI (Threat Intelligence) data connector properties.
- All required parameters must be populated in order to send to Azure.
+class ThreatIntelligenceMetricEntity(_serialization.Model):
+ """Describes threat intelligence metric entity.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar tip_lookback_period: The lookback period for the feed to be imported.
- :vartype tip_lookback_period: ~datetime.datetime
- :ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
+ :ivar metric_name: Metric name.
+ :vartype metric_name: str
+ :ivar metric_value: Metric value.
+ :vartype metric_value: int
"""
- _validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
- }
-
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "tip_lookback_period": {"key": "tipLookbackPeriod", "type": "iso-8601"},
- "data_types": {"key": "dataTypes", "type": "TIDataConnectorDataTypes"},
+ "metric_name": {"key": "metricName", "type": "str"},
+ "metric_value": {"key": "metricValue", "type": "int"},
}
- def __init__(
- self,
- *,
- tenant_id: str,
- data_types: "_models.TIDataConnectorDataTypes",
- tip_lookback_period: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ def __init__(self, *, metric_name: Optional[str] = None, metric_value: Optional[int] = None, **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword tip_lookback_period: The lookback period for the feed to be imported.
- :paramtype tip_lookback_period: ~datetime.datetime
- :keyword data_types: The available data types for the connector. Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
+ :keyword metric_name: Metric name.
+ :paramtype metric_name: str
+ :keyword metric_value: Metric value.
+ :paramtype metric_value: int
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.tip_lookback_period = tip_lookback_period
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.metric_name = metric_name
+ self.metric_value = metric_value
-class TimelineAggregation(_serialization.Model):
- """timeline aggregation information per kind.
- All required parameters must be populated in order to send to Azure.
+class ThreatIntelligenceMetrics(_serialization.Model):
+ """Threat intelligence metrics.
- :ivar count: the total items found for a kind. Required.
- :vartype count: int
- :ivar kind: the query kind. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
+ :ivar properties: Threat intelligence metrics.
+ :vartype properties: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetric
"""
- _validation = {
- "count": {"required": True},
- "kind": {"required": True},
- }
-
_attribute_map = {
- "count": {"key": "count", "type": "int"},
- "kind": {"key": "kind", "type": "str"},
+ "properties": {"key": "properties", "type": "ThreatIntelligenceMetric"},
}
- def __init__(self, *, count: int, kind: Union[str, "_models.EntityTimelineKind"], **kwargs):
+ def __init__(self, *, properties: Optional["_models.ThreatIntelligenceMetric"] = None, **kwargs: Any) -> None:
"""
- :keyword count: the total items found for a kind. Required.
- :paramtype count: int
- :keyword kind: the query kind. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
+ :keyword properties: Threat intelligence metrics.
+ :paramtype properties: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetric
"""
super().__init__(**kwargs)
- self.count = count
- self.kind = kind
+ self.properties = properties
-class TimelineError(_serialization.Model):
- """Timeline Query Errors.
+class ThreatIntelligenceMetricsList(_serialization.Model):
+ """List of all the threat intelligence metric fields (type/threat type/source).
- All required parameters must be populated in order to send to Azure.
+ All required parameters must be populated in order to send to server.
- :ivar kind: the query kind. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- :ivar query_id: the query id.
- :vartype query_id: str
- :ivar error_message: the error message. Required.
- :vartype error_message: str
+ :ivar value: Array of threat intelligence metric fields (type/threat type/source). Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetrics]
"""
_validation = {
- "kind": {"required": True},
- "error_message": {"required": True},
+ "value": {"required": True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "query_id": {"key": "queryId", "type": "str"},
- "error_message": {"key": "errorMessage", "type": "str"},
+ "value": {"key": "value", "type": "[ThreatIntelligenceMetrics]"},
}
- def __init__(
- self,
- *,
- kind: Union[str, "_models.EntityTimelineKind"],
- error_message: str,
- query_id: Optional[str] = None,
- **kwargs
- ):
- """
- :keyword kind: the query kind. Required. Known values are: "Activity", "Bookmark",
- "SecurityAlert", and "Anomaly".
- :paramtype kind: str or ~azure.mgmt.securityinsight.models.EntityTimelineKind
- :keyword query_id: the query id.
- :paramtype query_id: str
- :keyword error_message: the error message. Required.
- :paramtype error_message: str
+ def __init__(self, *, value: List["_models.ThreatIntelligenceMetrics"], **kwargs: Any) -> None:
+ """
+ :keyword value: Array of threat intelligence metric fields (type/threat type/source). Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceMetrics]
"""
super().__init__(**kwargs)
- self.kind = kind
- self.query_id = query_id
- self.error_message = error_message
-
+ self.value = value
-class TimelineResultsMetadata(_serialization.Model):
- """Expansion result metadata.
- All required parameters must be populated in order to send to Azure.
+class ThreatIntelligenceParsedPattern(_serialization.Model):
+ """Describes parsed pattern entity.
- :ivar total_count: the total items found for the timeline request. Required.
- :vartype total_count: int
- :ivar aggregations: timeline aggregation per kind. Required.
- :vartype aggregations: list[~azure.mgmt.securityinsight.models.TimelineAggregation]
- :ivar errors: information about the failure queries.
- :vartype errors: list[~azure.mgmt.securityinsight.models.TimelineError]
+ :ivar pattern_type_key: Pattern type key.
+ :vartype pattern_type_key: str
+ :ivar pattern_type_values: Pattern type keys.
+ :vartype pattern_type_values:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPatternTypeValue]
"""
- _validation = {
- "total_count": {"required": True},
- "aggregations": {"required": True},
- }
-
_attribute_map = {
- "total_count": {"key": "totalCount", "type": "int"},
- "aggregations": {"key": "aggregations", "type": "[TimelineAggregation]"},
- "errors": {"key": "errors", "type": "[TimelineError]"},
+ "pattern_type_key": {"key": "patternTypeKey", "type": "str"},
+ "pattern_type_values": {"key": "patternTypeValues", "type": "[ThreatIntelligenceParsedPatternTypeValue]"},
}
def __init__(
self,
*,
- total_count: int,
- aggregations: List["_models.TimelineAggregation"],
- errors: Optional[List["_models.TimelineError"]] = None,
- **kwargs
- ):
- """
- :keyword total_count: the total items found for the timeline request. Required.
- :paramtype total_count: int
- :keyword aggregations: timeline aggregation per kind. Required.
- :paramtype aggregations: list[~azure.mgmt.securityinsight.models.TimelineAggregation]
- :keyword errors: information about the failure queries.
- :paramtype errors: list[~azure.mgmt.securityinsight.models.TimelineError]
+ pattern_type_key: Optional[str] = None,
+ pattern_type_values: Optional[List["_models.ThreatIntelligenceParsedPatternTypeValue"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword pattern_type_key: Pattern type key.
+ :paramtype pattern_type_key: str
+ :keyword pattern_type_values: Pattern type keys.
+ :paramtype pattern_type_values:
+ list[~azure.mgmt.securityinsight.models.ThreatIntelligenceParsedPatternTypeValue]
"""
super().__init__(**kwargs)
- self.total_count = total_count
- self.aggregations = aggregations
- self.errors = errors
-
+ self.pattern_type_key = pattern_type_key
+ self.pattern_type_values = pattern_type_values
-class TiTaxiiCheckRequirements(DataConnectorsCheckRequirements):
- """Threat Intelligence TAXII data connector check requirements.
- All required parameters must be populated in order to send to Azure.
+class ThreatIntelligenceParsedPatternTypeValue(_serialization.Model):
+ """Describes threat kill chain phase entity.
- :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
- "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
- "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
- "Office365Project", "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
- :ivar tenant_id: The tenant id to connect to, and get the data from.
- :vartype tenant_id: str
+ :ivar value_type: Type of the value.
+ :vartype value_type: str
+ :ivar value: Value of parsed pattern.
+ :vartype value: str
"""
- _validation = {
- "kind": {"required": True},
- }
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "value_type": {"key": "valueType", "type": "str"},
+ "value": {"key": "value", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(self, *, value_type: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword value_type: Type of the value.
+ :paramtype value_type: str
+ :keyword value: Value of parsed pattern.
+ :paramtype value: str
"""
super().__init__(**kwargs)
- self.kind: str = "ThreatIntelligenceTaxii"
- self.tenant_id = tenant_id
-
+ self.value_type = value_type
+ self.value = value
-class TiTaxiiCheckRequirementsProperties(DataConnectorTenantId):
- """Threat Intelligence TAXII data connector required properties.
- All required parameters must be populated in order to send to Azure.
+class ThreatIntelligenceSortingCriteria(_serialization.Model):
+ """List of available columns for sorting.
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
+ :ivar item_key: Column name.
+ :vartype item_key: str
+ :ivar sort_order: Sorting order (ascending/descending/unsorted). Known values are: "unsorted",
+ "ascending", and "descending".
+ :vartype sort_order: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceSortingOrder
"""
- _validation = {
- "tenant_id": {"required": True},
- }
-
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "item_key": {"key": "itemKey", "type": "str"},
+ "sort_order": {"key": "sortOrder", "type": "str"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ item_key: Optional[str] = None,
+ sort_order: Optional[Union[str, "_models.ThreatIntelligenceSortingOrder"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword item_key: Column name.
+ :paramtype item_key: str
+ :keyword sort_order: Sorting order (ascending/descending/unsorted). Known values are:
+ "unsorted", "ascending", and "descending".
+ :paramtype sort_order: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceSortingOrder
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.item_key = item_key
+ self.sort_order = sort_order
-class TiTaxiiDataConnector(DataConnector): # pylint: disable=too-many-instance-attributes
- """Data connector to pull Threat intelligence data from TAXII 2.0/2.1 server.
+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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -22839,33 +17492,16 @@ class TiTaxiiDataConnector(DataConnector): # pylint: disable=too-many-instance-
:vartype etag: str
:ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
"AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
- "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
- "OfficePowerBI", "AmazonWebServicesCloudTrail", "AmazonWebServicesS3",
- "AzureAdvancedThreatProtection", "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365",
- "MicrosoftThreatProtection", "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", and
- "IOT".
+ "MicrosoftThreatIntelligence", "PremiumMicrosoftDefenderForThreatIntelligence", "Office365",
+ "AmazonWebServicesCloudTrail", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar tenant_id: The tenant id to connect to, and get the data from.
:vartype tenant_id: str
- :ivar workspace_id: The workspace id.
- :vartype workspace_id: str
- :ivar friendly_name: The friendly name for the TAXII server.
- :vartype friendly_name: str
- :ivar taxii_server: The API root for the TAXII server.
- :vartype taxii_server: str
- :ivar collection_id: The collection id of the TAXII server.
- :vartype collection_id: str
- :ivar user_name: The userName for the TAXII server.
- :vartype user_name: str
- :ivar password: The password for the TAXII server.
- :vartype password: str
- :ivar taxii_lookback_period: The lookback period for the TAXII server.
- :vartype taxii_lookback_period: ~datetime.datetime
- :ivar polling_frequency: The polling frequency for the TAXII server. Known values are:
- "OnceAMinute", "OnceAnHour", and "OnceADay".
- :vartype polling_frequency: str or ~azure.mgmt.securityinsight.models.PollingFrequency
- :ivar data_types: The available data types for Threat Intelligence TAXII data connector.
- :vartype data_types: ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypes
+ :ivar tip_lookback_period: The lookback period for the feed to be imported.
+ :vartype tip_lookback_period: ~datetime.datetime
+ :ivar data_types: The available data types for the connector.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
"""
_validation = {
@@ -22884,15 +17520,8 @@ class TiTaxiiDataConnector(DataConnector): # pylint: disable=too-many-instance-
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"tenant_id": {"key": "properties.tenantId", "type": "str"},
- "workspace_id": {"key": "properties.workspaceId", "type": "str"},
- "friendly_name": {"key": "properties.friendlyName", "type": "str"},
- "taxii_server": {"key": "properties.taxiiServer", "type": "str"},
- "collection_id": {"key": "properties.collectionId", "type": "str"},
- "user_name": {"key": "properties.userName", "type": "str"},
- "password": {"key": "properties.password", "type": "str"},
- "taxii_lookback_period": {"key": "properties.taxiiLookbackPeriod", "type": "iso-8601"},
- "polling_frequency": {"key": "properties.pollingFrequency", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "TiTaxiiDataConnectorDataTypes"},
+ "tip_lookback_period": {"key": "properties.tipLookbackPeriod", "type": "iso-8601"},
+ "data_types": {"key": "properties.dataTypes", "type": "TIDataConnectorDataTypes"},
}
def __init__(
@@ -22900,282 +17529,67 @@ def __init__(
*,
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
- workspace_id: Optional[str] = None,
- friendly_name: Optional[str] = None,
- taxii_server: Optional[str] = None,
- collection_id: Optional[str] = None,
- user_name: Optional[str] = None,
- password: Optional[str] = None,
- taxii_lookback_period: Optional[datetime.datetime] = None,
- polling_frequency: Optional[Union[str, "_models.PollingFrequency"]] = None,
- data_types: Optional["_models.TiTaxiiDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ tip_lookback_period: Optional[datetime.datetime] = None,
+ data_types: Optional["_models.TIDataConnectorDataTypes"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
:keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
- :keyword workspace_id: The workspace id.
- :paramtype workspace_id: str
- :keyword friendly_name: The friendly name for the TAXII server.
- :paramtype friendly_name: str
- :keyword taxii_server: The API root for the TAXII server.
- :paramtype taxii_server: str
- :keyword collection_id: The collection id of the TAXII server.
- :paramtype collection_id: str
- :keyword user_name: The userName for the TAXII server.
- :paramtype user_name: str
- :keyword password: The password for the TAXII server.
- :paramtype password: str
- :keyword taxii_lookback_period: The lookback period for the TAXII server.
- :paramtype taxii_lookback_period: ~datetime.datetime
- :keyword polling_frequency: The polling frequency for the TAXII server. Known values are:
- "OnceAMinute", "OnceAnHour", and "OnceADay".
- :paramtype polling_frequency: str or ~azure.mgmt.securityinsight.models.PollingFrequency
- :keyword data_types: The available data types for Threat Intelligence TAXII data connector.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypes
+ :keyword tip_lookback_period: The lookback period for the feed to be imported.
+ :paramtype tip_lookback_period: ~datetime.datetime
+ :keyword data_types: The available data types for the connector.
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "ThreatIntelligenceTaxii"
+ self.kind: str = "ThreatIntelligence"
self.tenant_id = tenant_id
- self.workspace_id = workspace_id
- self.friendly_name = friendly_name
- self.taxii_server = taxii_server
- self.collection_id = collection_id
- self.user_name = user_name
- self.password = password
- self.taxii_lookback_period = taxii_lookback_period
- self.polling_frequency = polling_frequency
+ self.tip_lookback_period = tip_lookback_period
self.data_types = data_types
-class TiTaxiiDataConnectorDataTypes(_serialization.Model):
- """The available data types for Threat Intelligence TAXII data connector.
-
- All required parameters must be populated in order to send to Azure.
+class TIDataConnectorDataTypes(_serialization.Model):
+ """The available data types for TI (Threat Intelligence) data connector.
- :ivar taxii_client: Data type for TAXII connector. Required.
- :vartype taxii_client:
- ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypesTaxiiClient
+ :ivar indicators: Data type for indicators connection.
+ :vartype indicators: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators
"""
- _validation = {
- "taxii_client": {"required": True},
- }
-
_attribute_map = {
- "taxii_client": {"key": "taxiiClient", "type": "TiTaxiiDataConnectorDataTypesTaxiiClient"},
+ "indicators": {"key": "indicators", "type": "TIDataConnectorDataTypesIndicators"},
}
- def __init__(self, *, taxii_client: "_models.TiTaxiiDataConnectorDataTypesTaxiiClient", **kwargs):
+ def __init__(
+ self, *, indicators: Optional["_models.TIDataConnectorDataTypesIndicators"] = None, **kwargs: Any
+ ) -> None:
"""
- :keyword taxii_client: Data type for TAXII connector. Required.
- :paramtype taxii_client:
- ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypesTaxiiClient
+ :keyword indicators: Data type for indicators connection.
+ :paramtype indicators: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators
"""
super().__init__(**kwargs)
- self.taxii_client = taxii_client
-
+ self.indicators = indicators
-class TiTaxiiDataConnectorDataTypesTaxiiClient(DataConnectorDataTypeCommon):
- """Data type for TAXII connector.
- All required parameters must be populated in order to send to Azure.
+class TIDataConnectorDataTypesIndicators(DataConnectorDataTypeCommon):
+ """Data type for indicators connection.
- :ivar state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
+ :ivar state: Describe whether this data type connection is enabled or not. Known values are:
+ "Enabled" and "Disabled".
:vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
"""
- _validation = {
- "state": {"required": True},
- }
-
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
-
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
- """
- :keyword state: Describe whether this data type connection is enabled or not. Required. Known
- values are: "Enabled" and "Disabled".
- :paramtype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
- """
- super().__init__(state=state, **kwargs)
-
-
-class TiTaxiiDataConnectorProperties(DataConnectorTenantId):
- """Threat Intelligence TAXII data connector properties.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
- :ivar workspace_id: The workspace id.
- :vartype workspace_id: str
- :ivar friendly_name: The friendly name for the TAXII server.
- :vartype friendly_name: str
- :ivar taxii_server: The API root for the TAXII server.
- :vartype taxii_server: str
- :ivar collection_id: The collection id of the TAXII server.
- :vartype collection_id: str
- :ivar user_name: The userName for the TAXII server.
- :vartype user_name: str
- :ivar password: The password for the TAXII server.
- :vartype password: str
- :ivar taxii_lookback_period: The lookback period for the TAXII server.
- :vartype taxii_lookback_period: ~datetime.datetime
- :ivar polling_frequency: The polling frequency for the TAXII server. Required. Known values
- are: "OnceAMinute", "OnceAnHour", and "OnceADay".
- :vartype polling_frequency: str or ~azure.mgmt.securityinsight.models.PollingFrequency
- :ivar data_types: The available data types for Threat Intelligence TAXII data connector.
- Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypes
- """
-
- _validation = {
- "tenant_id": {"required": True},
- "polling_frequency": {"required": True},
- "data_types": {"required": True},
- }
-
- _attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "workspace_id": {"key": "workspaceId", "type": "str"},
- "friendly_name": {"key": "friendlyName", "type": "str"},
- "taxii_server": {"key": "taxiiServer", "type": "str"},
- "collection_id": {"key": "collectionId", "type": "str"},
- "user_name": {"key": "userName", "type": "str"},
- "password": {"key": "password", "type": "str"},
- "taxii_lookback_period": {"key": "taxiiLookbackPeriod", "type": "iso-8601"},
- "polling_frequency": {"key": "pollingFrequency", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "TiTaxiiDataConnectorDataTypes"},
- }
-
- def __init__(
- self,
- *,
- tenant_id: str,
- polling_frequency: Union[str, "_models.PollingFrequency"],
- data_types: "_models.TiTaxiiDataConnectorDataTypes",
- workspace_id: Optional[str] = None,
- friendly_name: Optional[str] = None,
- taxii_server: Optional[str] = None,
- collection_id: Optional[str] = None,
- user_name: Optional[str] = None,
- password: Optional[str] = None,
- taxii_lookback_period: Optional[datetime.datetime] = None,
- **kwargs
- ):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
- :keyword workspace_id: The workspace id.
- :paramtype workspace_id: str
- :keyword friendly_name: The friendly name for the TAXII server.
- :paramtype friendly_name: str
- :keyword taxii_server: The API root for the TAXII server.
- :paramtype taxii_server: str
- :keyword collection_id: The collection id of the TAXII server.
- :paramtype collection_id: str
- :keyword user_name: The userName for the TAXII server.
- :paramtype user_name: str
- :keyword password: The password for the TAXII server.
- :paramtype password: str
- :keyword taxii_lookback_period: The lookback period for the TAXII server.
- :paramtype taxii_lookback_period: ~datetime.datetime
- :keyword polling_frequency: The polling frequency for the TAXII server. Required. Known values
- are: "OnceAMinute", "OnceAnHour", and "OnceADay".
- :paramtype polling_frequency: str or ~azure.mgmt.securityinsight.models.PollingFrequency
- :keyword data_types: The available data types for Threat Intelligence TAXII data connector.
- Required.
- :paramtype data_types: ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypes
- """
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.workspace_id = workspace_id
- self.friendly_name = friendly_name
- self.taxii_server = taxii_server
- self.collection_id = collection_id
- self.user_name = user_name
- self.password = password
- self.taxii_lookback_period = taxii_lookback_period
- self.polling_frequency = polling_frequency
- self.data_types = data_types
-
-
-class Ueba(Settings):
- """Settings with single toggle.
-
- 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: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
- :vartype id: str
- :ivar name: The name of the resource.
- :vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
- :vartype type: str
- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.securityinsight.models.SystemData
- :ivar etag: Etag of the azure resource.
- :vartype etag: str
- :ivar kind: The kind of the setting. Required. Known values are: "Anomalies", "EyesOn",
- "EntityAnalytics", and "Ueba".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.SettingKind
- :ivar data_sources: The relevant data sources that enriched by ueba.
- :vartype data_sources: list[str or ~azure.mgmt.securityinsight.models.UebaDataSources]
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- "etag": {"key": "etag", "type": "str"},
- "kind": {"key": "kind", "type": "str"},
- "data_sources": {"key": "properties.dataSources", "type": "[str]"},
- }
-
- def __init__(
- self,
- *,
- etag: Optional[str] = None,
- data_sources: Optional[List[Union[str, "_models.UebaDataSources"]]] = None,
- **kwargs
- ):
- """
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword data_sources: The relevant data sources that enriched by ueba.
- :paramtype data_sources: list[str or ~azure.mgmt.securityinsight.models.UebaDataSources]
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Ueba"
- self.data_sources = data_sources
-
class UrlEntity(Entity):
"""Represents a url entity.
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.
+ All required parameters must be populated in order to send to server.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -23188,8 +17602,8 @@ class UrlEntity(Entity):
:ivar kind: The kind of the entity. Required. Known values are: "Account", "Host", "File",
"AzureResource", "CloudApplication", "DnsResolution", "FileHash", "Ip", "Malware", "Process",
"RegistryKey", "RegistryValue", "SecurityGroup", "Url", "IoTDevice", "SecurityAlert",
- "Bookmark", "MailCluster", "MailMessage", "Mailbox", "SubmissionMail", and "Nic".
- :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKind
+ "Bookmark", "MailCluster", "MailMessage", "Mailbox", and "SubmissionMail".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
:ivar additional_data: A bag of custom fields that should be part of the entity and will be
presented to the user.
:vartype additional_data: dict[str, any]
@@ -23222,7 +17636,7 @@ class UrlEntity(Entity):
"url": {"key": "properties.url", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.kind: str = "Url"
@@ -23258,7 +17672,7 @@ class UrlEntityProperties(EntityCommonProperties):
"url": {"key": "url", "type": "str"},
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.url = None
@@ -23288,7 +17702,7 @@ class UserInfo(_serialization.Model):
"object_id": {"key": "objectId", "type": "str"},
}
- def __init__(self, *, object_id: Optional[str] = None, **kwargs):
+ def __init__(self, *, object_id: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword object_id: The object id of the user.
:paramtype object_id: str
@@ -23299,43 +17713,74 @@ def __init__(self, *, object_id: Optional[str] = None, **kwargs):
self.object_id = object_id
-class ValidationError(_serialization.Model):
- """Describes an error encountered in the file during validation.
+class Warning(_serialization.Model):
+ """Warning response structure.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar record_index: The number of the record that has the error.
- :vartype record_index: int
- :ivar error_messages: A list of descriptions of the error.
- :vartype error_messages: list[str]
+ :ivar warning: Warning data.
+ :vartype warning: ~azure.mgmt.securityinsight.models.WarningBody
"""
_validation = {
- "error_messages": {"readonly": True},
+ "warning": {"readonly": True},
}
_attribute_map = {
- "record_index": {"key": "recordIndex", "type": "int"},
- "error_messages": {"key": "errorMessages", "type": "[str]"},
+ "warning": {"key": "warning", "type": "WarningBody"},
}
- def __init__(self, *, record_index: Optional[int] = None, **kwargs):
- """
- :keyword record_index: The number of the record that has the error.
- :paramtype record_index: int
- """
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
super().__init__(**kwargs)
- self.record_index = record_index
- self.error_messages = None
+ self.warning = None
-class Watchlist(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+class WarningBody(_serialization.Model):
+ """Warning details.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: An identifier for the warning. Codes are invariant and are intended to be consumed
+ programmatically. Known values are: "SourceControlWarning_DeleteServicePrincipal",
+ "SourceControlWarning_DeletePipelineFromAzureDevOps",
+ "SourceControlWarning_DeleteWorkflowAndSecretFromGitHub",
+ "SourceControlWarning_DeleteRoleAssignment", and "SourceControl_DeletedWithWarnings".
+ :vartype code: str or ~azure.mgmt.securityinsight.models.WarningCode
+ :ivar message: A message describing the warning, intended to be suitable for display in a user
+ interface.
+ :vartype message: str
+ :ivar details:
+ :vartype details: list[~azure.mgmt.securityinsight.models.WarningBody]
+ """
+
+ _validation = {
+ "code": {"readonly": True},
+ "message": {"readonly": True},
+ "details": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "details": {"key": "details", "type": "[WarningBody]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.code = None
+ self.message = None
+ self.details = None
+
+
+class Watchlist(ResourceWithEtag):
"""Represents a Watchlist in Azure Security Insights.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -23393,9 +17838,12 @@ class Watchlist(ResourceWithEtag): # pylint: disable=too-many-instance-attribut
:vartype items_search_key: str
:ivar content_type: The content type of the raw content. Example : text/csv or text/tsv.
:vartype content_type: str
- :ivar upload_status: The status of the Watchlist upload : New, InProgress or Complete. Pls note
- : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted.
+ :ivar upload_status: The status of the Watchlist upload : New, InProgress or Complete. **Note**
+ : When a Watchlist upload status is InProgress, the Watchlist cannot be deleted.
:vartype upload_status: str
+ :ivar provisioning_state: Describes provisioning state. Known values are: "New", "InProgress",
+ "Uploading", "Deleting", "Succeeded", "Failed", and "Canceled".
+ :vartype provisioning_state: str or ~azure.mgmt.securityinsight.models.ProvisioningState
"""
_validation = {
@@ -23403,6 +17851,7 @@ class Watchlist(ResourceWithEtag): # pylint: disable=too-many-instance-attribut
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
+ "provisioning_state": {"readonly": True},
}
_attribute_map = {
@@ -23432,6 +17881,7 @@ class Watchlist(ResourceWithEtag): # pylint: disable=too-many-instance-attribut
"items_search_key": {"key": "properties.itemsSearchKey", "type": "str"},
"content_type": {"key": "properties.contentType", "type": "str"},
"upload_status": {"key": "properties.uploadStatus", "type": "str"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
}
def __init__( # pylint: disable=too-many-locals
@@ -23459,8 +17909,8 @@ def __init__( # pylint: disable=too-many-locals
items_search_key: Optional[str] = None,
content_type: Optional[str] = None,
upload_status: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -23510,8 +17960,8 @@ def __init__( # pylint: disable=too-many-locals
:paramtype items_search_key: str
:keyword content_type: The content type of the raw content. Example : text/csv or text/tsv.
:paramtype content_type: str
- :keyword upload_status: The status of the Watchlist upload : New, InProgress or Complete. Pls
- note : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted.
+ :keyword upload_status: The status of the Watchlist upload : New, InProgress or Complete.
+ **Note** : When a Watchlist upload status is InProgress, the Watchlist cannot be deleted.
:paramtype upload_status: str
"""
super().__init__(etag=etag, **kwargs)
@@ -23536,15 +17986,16 @@ def __init__( # pylint: disable=too-many-locals
self.items_search_key = items_search_key
self.content_type = content_type
self.upload_status = upload_status
+ self.provisioning_state = None
-class WatchlistItem(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Represents a Watchlist item in Azure Security Insights.
+class WatchlistItem(ResourceWithEtag):
+ """Represents a Watchlist Item in Azure Security Insights.
Variables are only populated by the server, and will be ignored when sending a request.
- :ivar id: Fully qualified resource ID for the resource. Ex -
- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
@@ -23573,9 +18024,9 @@ class WatchlistItem(ResourceWithEtag): # pylint: disable=too-many-instance-attr
:ivar updated_by: Describes a user that updated the watchlist item.
:vartype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
:ivar items_key_value: key-value pairs for a watchlist item.
- :vartype items_key_value: dict[str, any]
+ :vartype items_key_value: JSON
:ivar entity_mapping: key-value pairs for a watchlist item entity mapping.
- :vartype entity_mapping: dict[str, any]
+ :vartype entity_mapping: JSON
"""
_validation = {
@@ -23599,8 +18050,8 @@ class WatchlistItem(ResourceWithEtag): # pylint: disable=too-many-instance-attr
"updated": {"key": "properties.updated", "type": "iso-8601"},
"created_by": {"key": "properties.createdBy", "type": "UserInfo"},
"updated_by": {"key": "properties.updatedBy", "type": "UserInfo"},
- "items_key_value": {"key": "properties.itemsKeyValue", "type": "{object}"},
- "entity_mapping": {"key": "properties.entityMapping", "type": "{object}"},
+ "items_key_value": {"key": "properties.itemsKeyValue", "type": "object"},
+ "entity_mapping": {"key": "properties.entityMapping", "type": "object"},
}
def __init__(
@@ -23615,10 +18066,10 @@ def __init__(
updated: Optional[datetime.datetime] = None,
created_by: Optional["_models.UserInfo"] = None,
updated_by: Optional["_models.UserInfo"] = None,
- items_key_value: Optional[Dict[str, Any]] = None,
- entity_mapping: Optional[Dict[str, Any]] = None,
- **kwargs
- ):
+ items_key_value: Optional[JSON] = None,
+ entity_mapping: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -23639,9 +18090,9 @@ def __init__(
:keyword updated_by: Describes a user that updated the watchlist item.
:paramtype updated_by: ~azure.mgmt.securityinsight.models.UserInfo
:keyword items_key_value: key-value pairs for a watchlist item.
- :paramtype items_key_value: dict[str, any]
+ :paramtype items_key_value: JSON
:keyword entity_mapping: key-value pairs for a watchlist item entity mapping.
- :paramtype entity_mapping: dict[str, any]
+ :paramtype entity_mapping: JSON
"""
super().__init__(etag=etag, **kwargs)
self.watchlist_item_type = watchlist_item_type
@@ -23661,9 +18112,9 @@ class WatchlistItemList(_serialization.Model):
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.
+ All required parameters must be populated in order to send to server.
- :ivar next_link: URL to fetch the next set of watchlist item.
+ :ivar next_link: URL to fetch the next set of watchlist items.
:vartype next_link: str
:ivar value: Array of watchlist items. Required.
:vartype value: list[~azure.mgmt.securityinsight.models.WatchlistItem]
@@ -23679,7 +18130,7 @@ class WatchlistItemList(_serialization.Model):
"value": {"key": "value", "type": "[WatchlistItem]"},
}
- def __init__(self, *, value: List["_models.WatchlistItem"], **kwargs):
+ def __init__(self, *, value: List["_models.WatchlistItem"], **kwargs: Any) -> None:
"""
:keyword value: Array of watchlist items. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.WatchlistItem]
@@ -23694,7 +18145,7 @@ class WatchlistList(_serialization.Model):
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.
+ All required parameters must be populated in order to send to server.
:ivar next_link: URL to fetch the next set of watchlists.
:vartype next_link: str
@@ -23712,7 +18163,7 @@ class WatchlistList(_serialization.Model):
"value": {"key": "value", "type": "[Watchlist]"},
}
- def __init__(self, *, value: List["_models.Watchlist"], **kwargs):
+ def __init__(self, *, value: List["_models.Watchlist"], **kwargs: Any) -> None:
"""
:keyword value: Array of watchlist. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.Watchlist]
@@ -23725,45 +18176,39 @@ def __init__(self, *, value: List["_models.Watchlist"], **kwargs):
class Webhook(_serialization.Model):
"""Detail about the webhook object.
+ Variables are only populated by the server, and will be ignored when sending a request.
+
:ivar webhook_id: Unique identifier for the webhook.
:vartype webhook_id: str
:ivar webhook_url: URL that gets invoked by the webhook.
:vartype webhook_url: str
:ivar webhook_secret_update_time: Time when the webhook secret was updated.
- :vartype webhook_secret_update_time: str
+ :vartype webhook_secret_update_time: ~datetime.datetime
:ivar rotate_webhook_secret: A flag to instruct the backend service to rotate webhook secret.
:vartype rotate_webhook_secret: bool
"""
+ _validation = {
+ "webhook_id": {"readonly": True},
+ "webhook_url": {"readonly": True},
+ "webhook_secret_update_time": {"readonly": True},
+ }
+
_attribute_map = {
"webhook_id": {"key": "webhookId", "type": "str"},
"webhook_url": {"key": "webhookUrl", "type": "str"},
- "webhook_secret_update_time": {"key": "webhookSecretUpdateTime", "type": "str"},
+ "webhook_secret_update_time": {"key": "webhookSecretUpdateTime", "type": "iso-8601"},
"rotate_webhook_secret": {"key": "rotateWebhookSecret", "type": "bool"},
}
- def __init__(
- self,
- *,
- webhook_id: Optional[str] = None,
- webhook_url: Optional[str] = None,
- webhook_secret_update_time: Optional[str] = None,
- rotate_webhook_secret: Optional[bool] = None,
- **kwargs
- ):
- """
- :keyword webhook_id: Unique identifier for the webhook.
- :paramtype webhook_id: str
- :keyword webhook_url: URL that gets invoked by the webhook.
- :paramtype webhook_url: str
- :keyword webhook_secret_update_time: Time when the webhook secret was updated.
- :paramtype webhook_secret_update_time: str
+ def __init__(self, *, rotate_webhook_secret: Optional[bool] = None, **kwargs: Any) -> None:
+ """
:keyword rotate_webhook_secret: A flag to instruct the backend service to rotate webhook
secret.
:paramtype rotate_webhook_secret: bool
"""
super().__init__(**kwargs)
- self.webhook_id = webhook_id
- self.webhook_url = webhook_url
- self.webhook_secret_update_time = webhook_secret_update_time
+ self.webhook_id = None
+ self.webhook_url = None
+ self.webhook_secret_update_time = None
self.rotate_webhook_secret = rotate_webhook_secret
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_security_insights_enums.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_security_insights_enums.py
index 455b7f96600f..912e4527e676 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_security_insights_enums.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/_security_insights_enums.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -13,44 +14,44 @@
class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of the automation rule action."""
- #: Modify an object's properties
MODIFY_PROPERTIES = "ModifyProperties"
- #: Run a playbook on an object
+ """Modify an object's properties"""
RUN_PLAYBOOK = "RunPlaybook"
- #: Add a task to an incident object
+ """Run a playbook on an object"""
ADD_INCIDENT_TASK = "AddIncidentTask"
+ """Add a task to an incident object"""
class AlertDetail(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Alert detail."""
- #: Alert display name
DISPLAY_NAME = "DisplayName"
- #: Alert severity
+ """Alert display name"""
SEVERITY = "Severity"
+ """Alert severity"""
class AlertProperty(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The V3 alert property."""
- #: Alert's link
ALERT_LINK = "AlertLink"
- #: Confidence level property
+ """Alert's link"""
CONFIDENCE_LEVEL = "ConfidenceLevel"
- #: Confidence score
+ """Confidence level property"""
CONFIDENCE_SCORE = "ConfidenceScore"
- #: Extended links to the alert
+ """Confidence score"""
EXTENDED_LINKS = "ExtendedLinks"
- #: Product name alert property
+ """Extended links to the alert"""
PRODUCT_NAME = "ProductName"
- #: Provider name alert property
+ """Product name alert property"""
PROVIDER_NAME = "ProviderName"
- #: Product component name alert property
+ """Provider name alert property"""
PRODUCT_COMPONENT_NAME = "ProductComponentName"
- #: Remediation steps alert property
+ """Product component name alert property"""
REMEDIATION_STEPS = "RemediationSteps"
- #: Techniques alert property
+ """Remediation steps alert property"""
TECHNIQUES = "Techniques"
+ """Techniques alert property"""
class AlertRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -59,50 +60,47 @@ class AlertRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
SCHEDULED = "Scheduled"
MICROSOFT_SECURITY_INCIDENT_CREATION = "MicrosoftSecurityIncidentCreation"
FUSION = "Fusion"
- ML_BEHAVIOR_ANALYTICS = "MLBehaviorAnalytics"
- THREAT_INTELLIGENCE = "ThreatIntelligence"
- NRT = "NRT"
class AlertSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The severity of the alert."""
- #: High severity
HIGH = "High"
- #: Medium severity
+ """High severity"""
MEDIUM = "Medium"
- #: Low severity
+ """Medium severity"""
LOW = "Low"
- #: Informational severity
+ """Low severity"""
INFORMATIONAL = "Informational"
+ """Informational severity"""
class AlertStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The lifecycle status of the alert."""
- #: Unknown value
UNKNOWN = "Unknown"
- #: New alert
+ """Unknown value"""
NEW = "New"
- #: Alert closed after handling
+ """New alert"""
RESOLVED = "Resolved"
- #: Alert dismissed as false positive
+ """Alert closed after handling"""
DISMISSED = "Dismissed"
- #: Alert is being handled
+ """Alert dismissed as false positive"""
IN_PROGRESS = "InProgress"
+ """Alert is being handled"""
class AntispamMailDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The directionality of this mail message."""
- #: Unknown
UNKNOWN = "Unknown"
- #: Inbound
+ """Unknown"""
INBOUND = "Inbound"
- #: Outbound
+ """Inbound"""
OUTBOUND = "Outbound"
- #: Intraorg
+ """Outbound"""
INTRAORG = "Intraorg"
+ """Intraorg"""
class AttackTactic(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -128,251 +126,256 @@ class AttackTactic(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class AutomationRuleBooleanConditionSupportedOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """AutomationRuleBooleanConditionSupportedOperator."""
+ """Describes a boolean condition operator."""
- #: Evaluates as true if all the item conditions are evaluated as true
AND = "And"
- #: Evaluates as true if at least one of the item conditions are evaluated as true
+ """Evaluates as true if all the item conditions are evaluated as true"""
OR = "Or"
+ """Evaluates as true if at least one of the item conditions are evaluated as true"""
+ AND_ENUM = "And"
+ """Evaluates as true if all the item conditions are evaluated as true"""
+ OR_ENUM = "Or"
+ """Evaluates as true if at least one of the item conditions are evaluated as true"""
class AutomationRulePropertyArrayChangedConditionSupportedArrayType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""AutomationRulePropertyArrayChangedConditionSupportedArrayType."""
- #: Evaluate the condition on the alerts
ALERTS = "Alerts"
- #: Evaluate the condition on the labels
+ """Evaluate the condition on the alerts"""
LABELS = "Labels"
- #: Evaluate the condition on the tactics
+ """Evaluate the condition on the labels"""
TACTICS = "Tactics"
- #: Evaluate the condition on the comments
+ """Evaluate the condition on the tactics"""
COMMENTS = "Comments"
+ """Evaluate the condition on the comments"""
class AutomationRulePropertyArrayChangedConditionSupportedChangeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""AutomationRulePropertyArrayChangedConditionSupportedChangeType."""
- #: Evaluate the condition on items added to the array
ADDED = "Added"
+ """Evaluate the condition on items added to the array"""
class AutomationRulePropertyArrayConditionSupportedArrayConditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """AutomationRulePropertyArrayConditionSupportedArrayConditionType."""
+ """Describes an array condition evaluation type."""
- #: Evaluate the condition as true if any item fulfills it
ANY_ITEM = "AnyItem"
+ """Evaluate the condition as true if any item fulfills it"""
class AutomationRulePropertyArrayConditionSupportedArrayType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """AutomationRulePropertyArrayConditionSupportedArrayType."""
+ """Describes an array condition evaluated array type."""
- #: Evaluate the condition on the custom detail keys
CUSTOM_DETAILS = "CustomDetails"
- #: Evaluate the condition on a custom detail's values
+ """Evaluate the condition on the custom detail keys"""
CUSTOM_DETAIL_VALUES = "CustomDetailValues"
+ """Evaluate the condition on a custom detail's values"""
class AutomationRulePropertyChangedConditionSupportedChangedType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""AutomationRulePropertyChangedConditionSupportedChangedType."""
- #: Evaluate the condition on the previous value of the property
CHANGED_FROM = "ChangedFrom"
- #: Evaluate the condition on the updated value of the property
+ """Evaluate the condition on the previous value of the property"""
CHANGED_TO = "ChangedTo"
+ """Evaluate the condition on the updated value of the property"""
class AutomationRulePropertyChangedConditionSupportedPropertyType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""AutomationRulePropertyChangedConditionSupportedPropertyType."""
- #: Evaluate the condition on the incident severity
INCIDENT_SEVERITY = "IncidentSeverity"
- #: Evaluate the condition on the incident status
+ """Evaluate the condition on the incident severity"""
INCIDENT_STATUS = "IncidentStatus"
- #: Evaluate the condition on the incident owner
+ """Evaluate the condition on the incident status"""
INCIDENT_OWNER = "IncidentOwner"
+ """Evaluate the condition on the incident owner"""
class AutomationRulePropertyConditionSupportedOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""AutomationRulePropertyConditionSupportedOperator."""
- #: Evaluates if the property equals at least one of the condition values
EQUALS = "Equals"
- #: Evaluates if the property does not equal any of the condition values
+ """Evaluates if the property equals at least one of the condition values"""
NOT_EQUALS = "NotEquals"
- #: Evaluates if the property contains at least one of the condition values
+ """Evaluates if the property does not equal any of the condition values"""
CONTAINS = "Contains"
- #: Evaluates if the property does not contain any of the condition values
+ """Evaluates if the property contains at least one of the condition values"""
NOT_CONTAINS = "NotContains"
- #: Evaluates if the property starts with any of the condition values
+ """Evaluates if the property does not contain any of the condition values"""
STARTS_WITH = "StartsWith"
- #: Evaluates if the property does not start with any of the condition values
+ """Evaluates if the property starts with any of the condition values"""
NOT_STARTS_WITH = "NotStartsWith"
- #: Evaluates if the property ends with any of the condition values
+ """Evaluates if the property does not start with any of the condition values"""
ENDS_WITH = "EndsWith"
- #: Evaluates if the property does not end with any of the condition values
+ """Evaluates if the property ends with any of the condition values"""
NOT_ENDS_WITH = "NotEndsWith"
+ """Evaluates if the property does not end with any of the condition values"""
class AutomationRulePropertyConditionSupportedProperty(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The property to evaluate in an automation rule property condition."""
- #: The title of the incident
INCIDENT_TITLE = "IncidentTitle"
- #: The description of the incident
+ """The title of the incident"""
INCIDENT_DESCRIPTION = "IncidentDescription"
- #: The severity of the incident
+ """The description of the incident"""
INCIDENT_SEVERITY = "IncidentSeverity"
- #: The status of the incident
+ """The severity of the incident"""
INCIDENT_STATUS = "IncidentStatus"
- #: The related Analytic rule ids of the incident
+ """The status of the incident"""
INCIDENT_RELATED_ANALYTIC_RULE_IDS = "IncidentRelatedAnalyticRuleIds"
- #: The tactics of the incident
+ """The related Analytic rule ids of the incident"""
INCIDENT_TACTICS = "IncidentTactics"
- #: The labels of the incident
+ """The tactics of the incident"""
INCIDENT_LABEL = "IncidentLabel"
- #: The provider name of the incident
+ """The labels of the incident"""
INCIDENT_PROVIDER_NAME = "IncidentProviderName"
- #: The update source of the incident
+ """The provider name of the incident"""
INCIDENT_UPDATED_BY_SOURCE = "IncidentUpdatedBySource"
- #: The incident custom detail key
+ """The update source of the incident"""
INCIDENT_CUSTOM_DETAILS_KEY = "IncidentCustomDetailsKey"
- #: The incident custom detail value
+ """The incident custom detail key"""
INCIDENT_CUSTOM_DETAILS_VALUE = "IncidentCustomDetailsValue"
- #: The account Azure Active Directory tenant id
+ """The incident custom detail value"""
ACCOUNT_AAD_TENANT_ID = "AccountAadTenantId"
- #: The account Azure Active Directory user id
+ """The account Azure Active Directory tenant id"""
ACCOUNT_AAD_USER_ID = "AccountAadUserId"
- #: The account name
+ """The account Azure Active Directory user id"""
ACCOUNT_NAME = "AccountName"
- #: The account NetBIOS domain name
+ """The account name"""
ACCOUNT_NT_DOMAIN = "AccountNTDomain"
- #: The account Azure Active Directory Passport User ID
+ """The account NetBIOS domain name"""
ACCOUNT_PUID = "AccountPUID"
- #: The account security identifier
+ """The account Azure Active Directory Passport User ID"""
ACCOUNT_SID = "AccountSid"
- #: The account unique identifier
+ """The account security identifier"""
ACCOUNT_OBJECT_GUID = "AccountObjectGuid"
- #: The account user principal name suffix
+ """The account unique identifier"""
ACCOUNT_UPN_SUFFIX = "AccountUPNSuffix"
- #: The name of the product of the alert
+ """The account user principal name suffix"""
ALERT_PRODUCT_NAMES = "AlertProductNames"
- #: The analytic rule ids of the alert
+ """The name of the product of the alert"""
ALERT_ANALYTIC_RULE_IDS = "AlertAnalyticRuleIds"
- #: The Azure resource id
+ """The analytic rule ids of the alert"""
AZURE_RESOURCE_RESOURCE_ID = "AzureResourceResourceId"
- #: The Azure resource subscription id
+ """The Azure resource id"""
AZURE_RESOURCE_SUBSCRIPTION_ID = "AzureResourceSubscriptionId"
- #: The cloud application identifier
+ """The Azure resource subscription id"""
CLOUD_APPLICATION_APP_ID = "CloudApplicationAppId"
- #: The cloud application name
+ """The cloud application identifier"""
CLOUD_APPLICATION_APP_NAME = "CloudApplicationAppName"
- #: The dns record domain name
+ """The cloud application name"""
DNS_DOMAIN_NAME = "DNSDomainName"
- #: The file directory full path
+ """The dns record domain name"""
FILE_DIRECTORY = "FileDirectory"
- #: The file name without path
+ """The file directory full path"""
FILE_NAME = "FileName"
- #: The file hash value
+ """The file name without path"""
FILE_HASH_VALUE = "FileHashValue"
- #: The host Azure resource id
+ """The file hash value"""
HOST_AZURE_ID = "HostAzureID"
- #: The host name without domain
+ """The host Azure resource id"""
HOST_NAME = "HostName"
- #: The host NetBIOS name
+ """The host name without domain"""
HOST_NET_BIOS_NAME = "HostNetBiosName"
- #: The host NT domain
+ """The host NetBIOS name"""
HOST_NT_DOMAIN = "HostNTDomain"
- #: The host operating system
+ """The host NT domain"""
HOST_OS_VERSION = "HostOSVersion"
- #: "The IoT device id
+ """The host operating system"""
IO_T_DEVICE_ID = "IoTDeviceId"
- #: The IoT device name
+ """"The IoT device id"""
IO_T_DEVICE_NAME = "IoTDeviceName"
- #: The IoT device type
+ """The IoT device name"""
IO_T_DEVICE_TYPE = "IoTDeviceType"
- #: The IoT device vendor
+ """The IoT device type"""
IO_T_DEVICE_VENDOR = "IoTDeviceVendor"
- #: The IoT device model
+ """The IoT device vendor"""
IO_T_DEVICE_MODEL = "IoTDeviceModel"
- #: The IoT device operating system
+ """The IoT device model"""
IO_T_DEVICE_OPERATING_SYSTEM = "IoTDeviceOperatingSystem"
- #: The IP address
+ """The IoT device operating system"""
IP_ADDRESS = "IPAddress"
- #: The mailbox display name
+ """The IP address"""
MAILBOX_DISPLAY_NAME = "MailboxDisplayName"
- #: The mailbox primary address
+ """The mailbox display name"""
MAILBOX_PRIMARY_ADDRESS = "MailboxPrimaryAddress"
- #: The mailbox user principal name
+ """The mailbox primary address"""
MAILBOX_UPN = "MailboxUPN"
- #: The mail message delivery action
+ """The mailbox user principal name"""
MAIL_MESSAGE_DELIVERY_ACTION = "MailMessageDeliveryAction"
- #: The mail message delivery location
+ """The mail message delivery action"""
MAIL_MESSAGE_DELIVERY_LOCATION = "MailMessageDeliveryLocation"
- #: The mail message recipient
+ """The mail message delivery location"""
MAIL_MESSAGE_RECIPIENT = "MailMessageRecipient"
- #: The mail message sender IP address
+ """The mail message recipient"""
MAIL_MESSAGE_SENDER_IP = "MailMessageSenderIP"
- #: The mail message subject
+ """The mail message sender IP address"""
MAIL_MESSAGE_SUBJECT = "MailMessageSubject"
- #: The mail message P1 sender
+ """The mail message subject"""
MAIL_MESSAGE_P1_SENDER = "MailMessageP1Sender"
- #: The mail message P2 sender
+ """The mail message P1 sender"""
MAIL_MESSAGE_P2_SENDER = "MailMessageP2Sender"
- #: The malware category
+ """The mail message P2 sender"""
MALWARE_CATEGORY = "MalwareCategory"
- #: The malware name
+ """The malware category"""
MALWARE_NAME = "MalwareName"
- #: The process execution command line
+ """The malware name"""
PROCESS_COMMAND_LINE = "ProcessCommandLine"
- #: The process id
+ """The process execution command line"""
PROCESS_ID = "ProcessId"
- #: The registry key path
+ """The process id"""
REGISTRY_KEY = "RegistryKey"
- #: The registry key value in string formatted representation
+ """The registry key path"""
REGISTRY_VALUE_DATA = "RegistryValueData"
- #: The url
+ """The registry key value in string formatted representation"""
URL = "Url"
+ """The url"""
-class Category(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Categories of recommendations."""
+class CcpAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of paging."""
- #: Onboarding recommendation.
- ONBOARDING = "Onboarding"
- #: New feature recommendation.
- NEW_FEATURE = "NewFeature"
- #: Soc Efficiency recommendation.
- SOC_EFFICIENCY = "SocEfficiency"
- #: Cost optimization recommendation.
- COST_OPTIMIZATION = "CostOptimization"
- #: Demo recommendation.
- DEMO = "Demo"
+ BASIC = "Basic"
+ API_KEY = "APIKey"
+ O_AUTH2 = "OAuth2"
+ AWS = "AWS"
+ GCP = "GCP"
+ SESSION = "Session"
+ JWT_TOKEN = "JwtToken"
+ GIT_HUB = "GitHub"
+ SERVICE_BUS = "ServiceBus"
+ ORACLE = "Oracle"
+ NONE = "None"
class ConditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""ConditionType."""
- #: Evaluate an object property value
PROPERTY = "Property"
- #: Evaluate an object array property value
+ """Evaluate an object property value"""
PROPERTY_ARRAY = "PropertyArray"
- #: Evaluate an object property changed value
+ """Evaluate an object array property value"""
PROPERTY_CHANGED = "PropertyChanged"
- #: Evaluate an object array property changed value
+ """Evaluate an object property changed value"""
PROPERTY_ARRAY_CHANGED = "PropertyArrayChanged"
- #: Apply a boolean operator (e.g AND, OR) to conditions
+ """Evaluate an object array property changed value"""
BOOLEAN = "Boolean"
+ """Apply a boolean operator (e.g AND, OR) to conditions"""
class ConfidenceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The confidence level of this alert."""
- #: Unknown confidence, the is the default value
UNKNOWN = "Unknown"
- #: Low confidence, meaning we have some doubts this is indeed malicious or part of an attack
+ """Unknown confidence, the is the default value"""
LOW = "Low"
- #: High confidence that the alert is true positive malicious
+ """Low confidence, meaning we have some doubts this is indeed malicious or part of an attack"""
HIGH = "High"
+ """High confidence that the alert is true positive malicious"""
class ConfidenceScoreStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -380,51 +383,28 @@ class ConfidenceScoreStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
this alert, not applicable or final.
"""
- #: Score will not be calculated for this alert as it is not supported by virtual analyst
NOT_APPLICABLE = "NotApplicable"
- #: No score was set yet and calculation is in progress
+ """Score will not be calculated for this alert as it is not supported by virtual analyst"""
IN_PROCESS = "InProcess"
- #: Score is calculated and shown as part of the alert, but may be updated again at a later time
- #: following the processing of additional data
+ """No score was set yet and calculation is in progress"""
NOT_FINAL = "NotFinal"
- #: Final score was calculated and available
+ """Score is calculated and shown as part of the alert, but may be updated again at a later time
+ following the processing of additional data"""
FINAL = "Final"
-
-
-class ConnectAuthKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The authentication kind used to poll the data."""
-
- BASIC = "Basic"
- O_AUTH2 = "OAuth2"
- API_KEY = "APIKey"
-
-
-class ConnectivityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """type of connectivity."""
-
- IS_CONNECTED_QUERY = "IsConnectedQuery"
+ """Final score was calculated and available"""
class ContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The content type of a source control path."""
- ANALYTIC_RULE = "AnalyticRule"
+ ANALYTICS_RULE = "AnalyticsRule"
+ AUTOMATION_RULE = "AutomationRule"
+ HUNTING_QUERY = "HuntingQuery"
+ PARSER = "Parser"
+ PLAYBOOK = "Playbook"
WORKBOOK = "Workbook"
-class Context(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Context of recommendation."""
-
- #: Analytics context.
- ANALYTICS = "Analytics"
- #: Incidents context.
- INCIDENTS = "Incidents"
- #: Overview context.
- OVERVIEW = "Overview"
- #: No context.
- NONE = "None"
-
-
class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of identity that created the resource."""
@@ -434,17 +414,10 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
KEY = "Key"
-class CustomEntityQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the entity query that supports put request."""
-
- ACTIVITY = "Activity"
-
-
-class DataConnectorAuthorizationState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Describes the state of user's authorization for a connector kind."""
+class DataConnectorDefinitionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the data connector definitions."""
- VALID = "Valid"
- INVALID = "Invalid"
+ CUSTOMIZABLE = "Customizable"
class DataConnectorKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -454,30 +427,13 @@ class DataConnectorKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AZURE_SECURITY_CENTER = "AzureSecurityCenter"
MICROSOFT_CLOUD_APP_SECURITY = "MicrosoftCloudAppSecurity"
THREAT_INTELLIGENCE = "ThreatIntelligence"
- THREAT_INTELLIGENCE_TAXII = "ThreatIntelligenceTaxii"
+ MICROSOFT_THREAT_INTELLIGENCE = "MicrosoftThreatIntelligence"
+ PREMIUM_MICROSOFT_DEFENDER_FOR_THREAT_INTELLIGENCE = "PremiumMicrosoftDefenderForThreatIntelligence"
OFFICE365 = "Office365"
- OFFICE_ATP = "OfficeATP"
- OFFICE_IRM = "OfficeIRM"
- OFFICE365_PROJECT = "Office365Project"
- OFFICE_POWER_BI = "OfficePowerBI"
AMAZON_WEB_SERVICES_CLOUD_TRAIL = "AmazonWebServicesCloudTrail"
- AMAZON_WEB_SERVICES_S3 = "AmazonWebServicesS3"
AZURE_ADVANCED_THREAT_PROTECTION = "AzureAdvancedThreatProtection"
MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = "MicrosoftDefenderAdvancedThreatProtection"
- DYNAMICS365 = "Dynamics365"
- MICROSOFT_THREAT_PROTECTION = "MicrosoftThreatProtection"
- MICROSOFT_THREAT_INTELLIGENCE = "MicrosoftThreatIntelligence"
- GENERIC_UI = "GenericUI"
- API_POLLING = "APIPolling"
- IOT = "IOT"
-
-
-class DataConnectorLicenseState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Describes the state of user's license for a connector kind."""
-
- VALID = "Valid"
- INVALID = "Invalid"
- UNKNOWN = "Unknown"
+ REST_API_POLLER = "RestApiPoller"
class DataTypeState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -487,53 +443,42 @@ class DataTypeState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
DISABLED = "Disabled"
-class DeleteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Indicates whether the file was deleted from the storage account."""
-
- #: The file was deleted.
- DELETED = "Deleted"
- #: The file was not deleted.
- NOT_DELETED = "NotDeleted"
- #: Unspecified
- UNSPECIFIED = "Unspecified"
-
-
class DeliveryAction(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The delivery action of this mail message like Delivered, Blocked, Replaced etc."""
- #: Unknown
UNKNOWN = "Unknown"
- #: DeliveredAsSpam
+ """Unknown"""
DELIVERED_AS_SPAM = "DeliveredAsSpam"
- #: Delivered
+ """DeliveredAsSpam"""
DELIVERED = "Delivered"
- #: Blocked
+ """Delivered"""
BLOCKED = "Blocked"
- #: Replaced
+ """Blocked"""
REPLACED = "Replaced"
+ """Replaced"""
class DeliveryLocation(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The delivery location of this mail message like Inbox, JunkFolder etc."""
- #: Unknown
UNKNOWN = "Unknown"
- #: Inbox
+ """Unknown"""
INBOX = "Inbox"
- #: JunkFolder
+ """Inbox"""
JUNK_FOLDER = "JunkFolder"
- #: DeletedFolder
+ """JunkFolder"""
DELETED_FOLDER = "DeletedFolder"
- #: Quarantine
+ """DeletedFolder"""
QUARANTINE = "Quarantine"
- #: External
+ """Quarantine"""
EXTERNAL = "External"
- #: Failed
+ """External"""
FAILED = "Failed"
- #: Dropped
+ """Failed"""
DROPPED = "Dropped"
- #: Forwarded
+ """Dropped"""
FORWARDED = "Forwarded"
+ """Forwarded"""
class DeploymentFetchStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -561,221 +506,103 @@ class DeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
CANCELING = "Canceling"
-class DeviceImportance(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Device importance, determines if the device classified as 'crown jewel'."""
-
- #: Unknown - Default value
- UNKNOWN = "Unknown"
- #: Low
- LOW = "Low"
- #: Normal
- NORMAL = "Normal"
- #: High
- HIGH = "High"
-
-
class ElevationToken(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The elevation token associated with the process."""
- #: Default elevation token
DEFAULT = "Default"
- #: Full elevation token
+ """Default elevation token"""
FULL = "Full"
- #: Limited elevation token
+ """Full elevation token"""
LIMITED = "Limited"
+ """Limited elevation token"""
-class EntityItemQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """EntityItemQueryKind."""
-
- #: insight
- INSIGHT = "Insight"
-
-
-class EntityKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+class EntityKindEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The kind of the entity."""
- #: Entity represents account in the system.
ACCOUNT = "Account"
- #: Entity represents host in the system.
+ """Entity represents account in the system."""
HOST = "Host"
- #: Entity represents file in the system.
+ """Entity represents host in the system."""
FILE = "File"
- #: Entity represents azure resource in the system.
+ """Entity represents file in the system."""
AZURE_RESOURCE = "AzureResource"
- #: Entity represents cloud application in the system.
+ """Entity represents azure resource in the system."""
CLOUD_APPLICATION = "CloudApplication"
- #: Entity represents dns resolution in the system.
+ """Entity represents cloud application in the system."""
DNS_RESOLUTION = "DnsResolution"
- #: Entity represents file hash in the system.
+ """Entity represents dns resolution in the system."""
FILE_HASH = "FileHash"
- #: Entity represents ip in the system.
+ """Entity represents file hash in the system."""
IP = "Ip"
- #: Entity represents malware in the system.
+ """Entity represents ip in the system."""
MALWARE = "Malware"
- #: Entity represents process in the system.
+ """Entity represents malware in the system."""
PROCESS = "Process"
- #: Entity represents registry key in the system.
+ """Entity represents process in the system."""
REGISTRY_KEY = "RegistryKey"
- #: Entity represents registry value in the system.
+ """Entity represents registry key in the system."""
REGISTRY_VALUE = "RegistryValue"
- #: Entity represents security group in the system.
+ """Entity represents registry value in the system."""
SECURITY_GROUP = "SecurityGroup"
- #: Entity represents url in the system.
+ """Entity represents security group in the system."""
URL = "Url"
- #: Entity represents IoT device in the system.
+ """Entity represents url in the system."""
IO_T_DEVICE = "IoTDevice"
- #: Entity represents security alert in the system.
+ """Entity represents IoT device in the system."""
SECURITY_ALERT = "SecurityAlert"
- #: Entity represents bookmark in the system.
+ """Entity represents security alert in the system."""
BOOKMARK = "Bookmark"
- #: Entity represents mail cluster in the system.
+ """Entity represents bookmark in the system."""
MAIL_CLUSTER = "MailCluster"
- #: Entity represents mail message in the system.
+ """Entity represents mail cluster in the system."""
MAIL_MESSAGE = "MailMessage"
- #: Entity represents mailbox in the system.
+ """Entity represents mail message in the system."""
MAILBOX = "Mailbox"
- #: Entity represents submission mail in the system.
+ """Entity represents mailbox in the system."""
SUBMISSION_MAIL = "SubmissionMail"
- #: Entity represents network interface in the system.
- NIC = "Nic"
+ """Entity represents submission mail in the system."""
class EntityMappingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The V3 type of the mapped entity."""
- #: User account entity type
ACCOUNT = "Account"
- #: Host entity type
+ """User account entity type"""
HOST = "Host"
- #: IP address entity type
+ """Host entity type"""
IP = "IP"
- #: Malware entity type
+ """IP address entity type"""
MALWARE = "Malware"
- #: System file entity type
+ """Malware entity type"""
FILE = "File"
- #: Process entity type
+ """System file entity type"""
PROCESS = "Process"
- #: Cloud app entity type
+ """Process entity type"""
CLOUD_APPLICATION = "CloudApplication"
- #: DNS entity type
+ """Cloud app entity type"""
DNS = "DNS"
- #: Azure resource entity type
+ """DNS entity type"""
AZURE_RESOURCE = "AzureResource"
- #: File-hash entity type
+ """Azure resource entity type"""
FILE_HASH = "FileHash"
- #: Registry key entity type
+ """File-hash entity type"""
REGISTRY_KEY = "RegistryKey"
- #: Registry value entity type
+ """Registry key entity type"""
REGISTRY_VALUE = "RegistryValue"
- #: Security group entity type
+ """Registry value entity type"""
SECURITY_GROUP = "SecurityGroup"
- #: URL entity type
+ """Security group entity type"""
URL = "URL"
- #: Mailbox entity type
+ """URL entity type"""
MAILBOX = "Mailbox"
- #: Mail cluster entity type
+ """Mailbox entity type"""
MAIL_CLUSTER = "MailCluster"
- #: Mail message entity type
+ """Mail cluster entity type"""
MAIL_MESSAGE = "MailMessage"
- #: Submission mail entity type
+ """Mail message entity type"""
SUBMISSION_MAIL = "SubmissionMail"
-
-
-class EntityProviders(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The entity provider that is synced."""
-
- ACTIVE_DIRECTORY = "ActiveDirectory"
- AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory"
-
-
-class EntityQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the entity query."""
-
- EXPANSION = "Expansion"
- INSIGHT = "Insight"
- ACTIVITY = "Activity"
-
-
-class EntityQueryTemplateKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the entity query template."""
-
- ACTIVITY = "Activity"
-
-
-class EntityTimelineKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The entity query kind."""
-
- #: activity
- ACTIVITY = "Activity"
- #: bookmarks
- BOOKMARK = "Bookmark"
- #: security alerts
- SECURITY_ALERT = "SecurityAlert"
- #: anomaly
- ANOMALY = "Anomaly"
-
-
-class EntityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The type of the entity."""
-
- #: Entity represents account in the system.
- ACCOUNT = "Account"
- #: Entity represents host in the system.
- HOST = "Host"
- #: Entity represents file in the system.
- FILE = "File"
- #: Entity represents azure resource in the system.
- AZURE_RESOURCE = "AzureResource"
- #: Entity represents cloud application in the system.
- CLOUD_APPLICATION = "CloudApplication"
- #: Entity represents dns in the system.
- DNS = "DNS"
- #: Entity represents file hash in the system.
- FILE_HASH = "FileHash"
- #: Entity represents ip in the system.
- IP = "IP"
- #: Entity represents malware in the system.
- MALWARE = "Malware"
- #: Entity represents process in the system.
- PROCESS = "Process"
- #: Entity represents registry key in the system.
- REGISTRY_KEY = "RegistryKey"
- #: Entity represents registry value in the system.
- REGISTRY_VALUE = "RegistryValue"
- #: Entity represents security group in the system.
- SECURITY_GROUP = "SecurityGroup"
- #: Entity represents url in the system.
- URL = "URL"
- #: Entity represents IoT device in the system.
- IO_T_DEVICE = "IoTDevice"
- #: Entity represents security alert in the system.
- SECURITY_ALERT = "SecurityAlert"
- #: Entity represents HuntingBookmark in the system.
- HUNTING_BOOKMARK = "HuntingBookmark"
- #: Entity represents mail cluster in the system.
- MAIL_CLUSTER = "MailCluster"
- #: Entity represents mail message in the system.
- MAIL_MESSAGE = "MailMessage"
- #: Entity represents mailbox in the system.
- MAILBOX = "Mailbox"
- #: Entity represents submission mail in the system.
- SUBMISSION_MAIL = "SubmissionMail"
- #: Entity represents network interface in the system.
- NIC = "Nic"
-
-
-class Enum13(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Enum13."""
-
- EXPANSION = "Expansion"
- ACTIVITY = "Activity"
-
-
-class Enum15(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Enum15."""
-
- ACTIVITY = "Activity"
+ """Submission mail entity type"""
class EventGroupingAggregationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -785,219 +612,176 @@ class EventGroupingAggregationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta)
ALERT_PER_RESULT = "AlertPerResult"
-class FileFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The format of the file."""
-
- #: A CSV file.
- CSV = "CSV"
- #: A JSON file.
- JSON = "JSON"
- #: A file of other format.
- UNSPECIFIED = "Unspecified"
-
-
class FileHashAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The hash algorithm type."""
- #: Unknown hash algorithm
UNKNOWN = "Unknown"
- #: MD5 hash type
+ """Unknown hash algorithm"""
MD5 = "MD5"
- #: SHA1 hash type
+ """MD5 hash type"""
SHA1 = "SHA1"
- #: SHA256 hash type
+ """SHA1 hash type"""
SHA256 = "SHA256"
- #: SHA256 Authenticode hash type
+ """SHA256 hash type"""
SHA256_AC = "SHA256AC"
+ """SHA256 Authenticode hash type"""
-class FileImportContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The content type of this file."""
+class Flag(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The boolean value the metadata is for."""
- #: File containing records with the core fields of an indicator, plus the observables to construct
- #: the STIX pattern.
- BASIC_INDICATOR = "BasicIndicator"
- #: File containing STIX indicators.
- STIX_INDICATOR = "StixIndicator"
- #: File containing other records.
- UNSPECIFIED = "Unspecified"
+ TRUE = "true"
+ FALSE = "false"
-class FileImportState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The state of the file import."""
-
- #: A fatal error has occurred while ingesting the file.
- FATAL_ERROR = "FatalError"
- #: The file has been ingested.
- INGESTED = "Ingested"
- #: The file has been ingested with errors.
- INGESTED_WITH_ERRORS = "IngestedWithErrors"
- #: The file ingestion is in progress.
- IN_PROGRESS = "InProgress"
- #: The file is invalid.
- INVALID = "Invalid"
- #: Waiting for the file to be uploaded.
- WAITING_FOR_UPLOAD = "WaitingForUpload"
- #: Unspecified state.
- UNSPECIFIED = "Unspecified"
+class HttpMethodVerb(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The HTTP method, default value GET."""
-
-class GetInsightsError(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """the query kind."""
-
- INSIGHT = "Insight"
+ GET = "GET"
+ POST = "POST"
+ PUT = "PUT"
+ DELETE = "DELETE"
class IncidentClassification(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The reason the incident was closed."""
- #: Incident classification was undetermined
UNDETERMINED = "Undetermined"
- #: Incident was true positive
+ """Incident classification was undetermined"""
TRUE_POSITIVE = "TruePositive"
- #: Incident was benign positive
+ """Incident was true positive"""
BENIGN_POSITIVE = "BenignPositive"
- #: Incident was false positive
+ """Incident was benign positive"""
FALSE_POSITIVE = "FalsePositive"
+ """Incident was false positive"""
class IncidentClassificationReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The classification reason the incident was closed with."""
- #: Classification reason was suspicious activity
SUSPICIOUS_ACTIVITY = "SuspiciousActivity"
- #: Classification reason was suspicious but expected
+ """Classification reason was suspicious activity"""
SUSPICIOUS_BUT_EXPECTED = "SuspiciousButExpected"
- #: Classification reason was incorrect alert logic
+ """Classification reason was suspicious but expected"""
INCORRECT_ALERT_LOGIC = "IncorrectAlertLogic"
- #: Classification reason was inaccurate data
+ """Classification reason was incorrect alert logic"""
INACCURATE_DATA = "InaccurateData"
+ """Classification reason was inaccurate data"""
class IncidentLabelType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of the label."""
- #: Label manually created by a user
USER = "User"
- #: Label automatically created by the system
+ """Label manually created by a user"""
AUTO_ASSIGNED = "AutoAssigned"
+ """Label automatically created by the system"""
class IncidentSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The severity of the incident."""
- #: High severity
HIGH = "High"
- #: Medium severity
+ """High severity"""
MEDIUM = "Medium"
- #: Low severity
+ """Medium severity"""
LOW = "Low"
- #: Informational severity
+ """Low severity"""
INFORMATIONAL = "Informational"
+ """Informational severity"""
class IncidentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the incident."""
- #: An active incident which isn't being handled currently
NEW = "New"
- #: An active incident which is being handled
+ """An active incident which isn't being handled currently"""
ACTIVE = "Active"
- #: A non-active incident
+ """An active incident which is being handled"""
CLOSED = "Closed"
+ """A non-active incident"""
class IncidentTaskStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """IncidentTaskStatus."""
+ """The status of the task."""
- #: A new task
NEW = "New"
- #: A completed task
+ """A new task"""
COMPLETED = "Completed"
-
-
-class IngestionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Describes how to ingest the records in the file."""
-
- #: No records should be ingested when invalid records are detected.
- INGEST_ONLY_IF_ALL_ARE_VALID = "IngestOnlyIfAllAreValid"
- #: Valid records should still be ingested when invalid records are detected.
- INGEST_ANY_VALID_RECORDS = "IngestAnyValidRecords"
- #: Unspecified
- UNSPECIFIED = "Unspecified"
+ """A completed task"""
class KillChainIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The intent of the alert."""
+ """Holds the alert intent stage(s) mapping for this alert."""
- #: The default value.
UNKNOWN = "Unknown"
- #: Probing could be an attempt to access a certain resource regardless of a malicious intent or a
- #: failed attempt to gain access to a target system to gather information prior to exploitation.
- #: This step is usually detected as an attempt originating from outside the network in attempt to
- #: scan the target system and find a way in.
+ """The default value."""
PROBING = "Probing"
- #: Exploitation is the stage where an attacker manage to get foothold on the attacked resource.
- #: This stage is applicable not only for compute hosts, but also for resources such as user
- #: accounts, certificates etc. Adversaries will often be able to control the resource after this
- #: stage.
+ """Probing could be an attempt to access a certain resource regardless of a malicious intent or a
+ failed attempt to gain access to a target system to gather information prior to exploitation.
+ This step is usually detected as an attempt originating from outside the network in attempt to
+ scan the target system and find a way in."""
EXPLOITATION = "Exploitation"
- #: Persistence is any access, action, or configuration change to a system that gives an adversary
- #: a persistent presence on that system. Adversaries will often need to maintain access to systems
- #: through interruptions such as system restarts, loss of credentials, or other failures that
- #: would require a remote access tool to restart or alternate backdoor for them to regain access.
+ """Exploitation is the stage where an attacker manage to get foothold on the attacked resource.
+ This stage is applicable not only for compute hosts, but also for resources such as user
+ accounts, certificates etc. Adversaries will often be able to control the resource after this
+ stage."""
PERSISTENCE = "Persistence"
- #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level
- #: of permissions on a system or network. Certain tools or actions require a higher level of
- #: privilege to work and are likely necessary at many points throughout an operation. User
- #: accounts with permissions to access specific systems or perform specific functions necessary
- #: for adversaries to achieve their objective may also be considered an escalation of privilege.
+ """Persistence is any access, action, or configuration change to a system that gives an adversary
+ a persistent presence on that system. Adversaries will often need to maintain access to systems
+ through interruptions such as system restarts, loss of credentials, or other failures that
+ would require a remote access tool to restart or alternate backdoor for them to regain access."""
PRIVILEGE_ESCALATION = "PrivilegeEscalation"
- #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other
- #: defenses. Sometimes these actions are the same as or variations of techniques in other
- #: categories that have the added benefit of subverting a particular defense or mitigation.
+ """Privilege escalation is the result of actions that allow an adversary to obtain a higher level
+ of permissions on a system or network. Certain tools or actions require a higher level of
+ privilege to work and are likely necessary at many points throughout an operation. User
+ accounts with permissions to access specific systems or perform specific functions necessary
+ for adversaries to achieve their objective may also be considered an escalation of privilege."""
DEFENSE_EVASION = "DefenseEvasion"
- #: Credential access represents techniques resulting in access to or control over system, domain,
- #: or service credentials that are used within an enterprise environment. Adversaries will likely
- #: attempt to obtain legitimate credentials from users or administrator accounts (local system
- #: administrator or domain users with administrator access) to use within the network. With
- #: sufficient access within a network, an adversary can create accounts for later use within the
- #: environment.
+ """Defense evasion consists of techniques an adversary may use to evade detection or avoid other
+ defenses. Sometimes these actions are the same as or variations of techniques in other
+ categories that have the added benefit of subverting a particular defense or mitigation."""
CREDENTIAL_ACCESS = "CredentialAccess"
- #: Discovery consists of techniques that allow the adversary to gain knowledge about the system
- #: and internal network. When adversaries gain access to a new system, they must orient themselves
- #: to what they now have control of and what benefits operating from that system give to their
- #: current objective or overall goals during the intrusion. The operating system provides many
- #: native tools that aid in this post-compromise information-gathering phase.
+ """Credential access represents techniques resulting in access to or control over system, domain,
+ or service credentials that are used within an enterprise environment. Adversaries will likely
+ attempt to obtain legitimate credentials from users or administrator accounts (local system
+ administrator or domain users with administrator access) to use within the network. With
+ sufficient access within a network, an adversary can create accounts for later use within the
+ environment."""
DISCOVERY = "Discovery"
- #: Lateral movement consists of techniques that enable an adversary to access and control remote
- #: systems on a network and could, but does not necessarily, include execution of tools on remote
- #: systems. The lateral movement techniques could allow an adversary to gather information from a
- #: system without needing additional tools, such as a remote access tool. An adversary can use
- #: lateral movement for many purposes, including remote Execution of tools, pivoting to additional
- #: systems, access to specific information or files, access to additional credentials, or to cause
- #: an effect.
+ """Discovery consists of techniques that allow the adversary to gain knowledge about the system
+ and internal network. When adversaries gain access to a new system, they must orient themselves
+ to what they now have control of and what benefits operating from that system give to their
+ current objective or overall goals during the intrusion. The operating system provides many
+ native tools that aid in this post-compromise information-gathering phase."""
LATERAL_MOVEMENT = "LateralMovement"
- #: The execution tactic represents techniques that result in execution of adversary-controlled
- #: code on a local or remote system. This tactic is often used in conjunction with lateral
- #: movement to expand access to remote systems on a network.
+ """Lateral movement consists of techniques that enable an adversary to access and control remote
+ systems on a network and could, but does not necessarily, include execution of tools on remote
+ systems. The lateral movement techniques could allow an adversary to gather information from a
+ system without needing additional tools, such as a remote access tool. An adversary can use
+ lateral movement for many purposes, including remote Execution of tools, pivoting to additional
+ systems, access to specific information or files, access to additional credentials, or to cause
+ an effect."""
EXECUTION = "Execution"
- #: Collection consists of techniques used to identify and gather information, such as sensitive
- #: files, from a target network prior to exfiltration. This category also covers locations on a
- #: system or network where the adversary may look for information to exfiltrate.
+ """The execution tactic represents techniques that result in execution of adversary-controlled
+ code on a local or remote system. This tactic is often used in conjunction with lateral
+ movement to expand access to remote systems on a network."""
COLLECTION = "Collection"
- #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing
- #: files and information from a target network. This category also covers locations on a system or
- #: network where the adversary may look for information to exfiltrate.
+ """Collection consists of techniques used to identify and gather information, such as sensitive
+ files, from a target network prior to exfiltration. This category also covers locations on a
+ system or network where the adversary may look for information to exfiltrate."""
EXFILTRATION = "Exfiltration"
- #: The command and control tactic represents how adversaries communicate with systems under their
- #: control within a target network.
+ """Exfiltration refers to techniques and attributes that result or aid in the adversary removing
+ files and information from a target network. This category also covers locations on a system or
+ network where the adversary may look for information to exfiltrate."""
COMMAND_AND_CONTROL = "CommandAndControl"
- #: The impact intent primary objective is to directly reduce the availability or integrity of a
- #: system, service, or network; including manipulation of data to impact a business or operational
- #: process. This would often refer to techniques such as ransom-ware, defacement, data
- #: manipulation and others.
+ """The command and control tactic represents how adversaries communicate with systems under their
+ control within a target network."""
IMPACT = "Impact"
+ """The impact intent primary objective is to directly reduce the availability or integrity of a
+ system, service, or network; including manipulation of data to impact a business or operational
+ process. This would often refer to techniques such as ransom-ware, defacement, data
+ manipulation and others."""
class Kind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1020,6 +804,14 @@ class Kind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AZURE_FUNCTION = "AzureFunction"
LOGIC_APPS_CUSTOM_CONNECTOR = "LogicAppsCustomConnector"
AUTOMATION_RULE = "AutomationRule"
+ RESOURCES_DATA_CONNECTOR = "ResourcesDataConnector"
+ """The Codeless Connector Platform (CCP) Connectors"""
+ NOTEBOOK = "Notebook"
+ """Jupyter Notebooks"""
+ STANDALONE = "Standalone"
+ """one-off / standalone content contributed by community contributors"""
+ SUMMARY_RULE = "SummaryRule"
+ """Summary rules perform batch processing directly in your Log Analytics workspace."""
class MatchingMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1027,13 +819,13 @@ class MatchingMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta):
groupByAlertDetails, groupByCustomDetails must be provided and not empty.
"""
- #: Grouping alerts into a single incident if all the entities match
ALL_ENTITIES = "AllEntities"
- #: Grouping any alerts triggered by this rule into a single incident
+ """Grouping alerts into a single incident if all the entities match"""
ANY_ALERT = "AnyAlert"
- #: Grouping alerts into a single incident if the selected entities, custom details and alert
- #: details match
+ """Grouping any alerts triggered by this rule into a single incident"""
SELECTED = "Selected"
+ """Grouping alerts into a single incident if the selected entities, custom details and alert
+ details match"""
class MicrosoftSecurityProductName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1044,8 +836,6 @@ class MicrosoftSecurityProductName(str, Enum, metaclass=CaseInsensitiveEnumMeta)
AZURE_ADVANCED_THREAT_PROTECTION = "Azure Advanced Threat Protection"
AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION = "Azure Active Directory Identity Protection"
AZURE_SECURITY_CENTER_FOR_IO_T = "Azure Security Center for IoT"
- OFFICE365_ADVANCED_THREAT_PROTECTION = "Office 365 Advanced Threat Protection"
- MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = "Microsoft Defender Advanced Threat Protection"
class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1053,107 +843,93 @@ class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AND = "AND"
OR = "OR"
+ AND_ENUM = "AND"
+ OR_ENUM = "OR"
class OSFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The operating system type."""
- #: Host with Linux operating system.
LINUX = "Linux"
- #: Host with Windows operating system.
+ """Host with Linux operating system."""
WINDOWS = "Windows"
- #: Host with Android operating system.
+ """Host with Windows operating system."""
ANDROID = "Android"
- #: Host with IOS operating system.
+ """Host with Android operating system."""
IOS = "IOS"
- #: Host with Unknown operating system.
+ """Host with IOS operating system."""
UNKNOWN = "Unknown"
-
-
-class OutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Insights Column type."""
-
- NUMBER = "Number"
- STRING = "String"
- DATE = "Date"
- ENTITY = "Entity"
+ """Host with Unknown operating system."""
class OwnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of the owner the incident is assigned to."""
- #: The incident owner type is unknown
UNKNOWN = "Unknown"
- #: The incident owner type is an AAD user
+ """The incident owner type is unknown"""
USER = "User"
- #: The incident owner type is an AAD group
+ """The incident owner type is an AAD user"""
GROUP = "Group"
+ """The incident owner type is an AAD group"""
-class PermissionProviderScope(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Permission provider scope."""
-
- RESOURCE_GROUP = "ResourceGroup"
- SUBSCRIPTION = "Subscription"
- WORKSPACE = "Workspace"
+class PackageKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The package kind."""
-
-class PollingFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The polling frequency for the TAXII server."""
-
- #: Once a minute
- ONCE_A_MINUTE = "OnceAMinute"
- #: Once an hour
- ONCE_AN_HOUR = "OnceAnHour"
- #: Once a day
- ONCE_A_DAY = "OnceADay"
+ SOLUTION = "Solution"
+ STANDALONE = "Standalone"
-class Priority(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Priority of recommendation."""
+class ProviderPermissionsScope(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The scope on which the user should have permissions, in order to be able to create connections."""
- #: Low priority for recommendation.
- LOW = "Low"
- #: Medium priority for recommendation.
- MEDIUM = "Medium"
- #: High priority for recommendation.
- HIGH = "High"
+ SUBSCRIPTION = "Subscription"
+ RESOURCE_GROUP = "ResourceGroup"
+ WORKSPACE = "Workspace"
-class ProviderName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Provider name."""
+class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Describes provisioning state."""
- MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS = "Microsoft.OperationalInsights/solutions"
- MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES = "Microsoft.OperationalInsights/workspaces"
- MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES = "Microsoft.OperationalInsights/workspaces/datasources"
- MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS = "microsoft.aadiam/diagnosticSettings"
- MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS = "Microsoft.OperationalInsights/workspaces/sharedKeys"
- MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS = "Microsoft.Authorization/policyAssignments"
+ NEW = "New"
+ """The New provisioning state."""
+ IN_PROGRESS = "InProgress"
+ """The InProgress provisioning state."""
+ UPLOADING = "Uploading"
+ """The Uploading provisioning state."""
+ DELETING = "Deleting"
+ """The Deleting provisioning state."""
+ SUCCEEDED = "Succeeded"
+ """The Succeeded provisioning state."""
+ FAILED = "Failed"
+ """The Failed provisioning state."""
+ CANCELED = "Canceled"
+ """The Canceled provisioning state."""
class RegistryHive(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""the hive that holds the registry key."""
- #: HKEY_LOCAL_MACHINE
HKEY_LOCAL_MACHINE = "HKEY_LOCAL_MACHINE"
- #: HKEY_CLASSES_ROOT
+ """HKEY_LOCAL_MACHINE"""
HKEY_CLASSES_ROOT = "HKEY_CLASSES_ROOT"
- #: HKEY_CURRENT_CONFIG
+ """HKEY_CLASSES_ROOT"""
HKEY_CURRENT_CONFIG = "HKEY_CURRENT_CONFIG"
- #: HKEY_USERS
+ """HKEY_CURRENT_CONFIG"""
HKEY_USERS = "HKEY_USERS"
- #: HKEY_CURRENT_USER_LOCAL_SETTINGS
+ """HKEY_USERS"""
HKEY_CURRENT_USER_LOCAL_SETTINGS = "HKEY_CURRENT_USER_LOCAL_SETTINGS"
- #: HKEY_PERFORMANCE_DATA
+ """HKEY_CURRENT_USER_LOCAL_SETTINGS"""
HKEY_PERFORMANCE_DATA = "HKEY_PERFORMANCE_DATA"
- #: HKEY_PERFORMANCE_NLSTEXT
+ """HKEY_PERFORMANCE_DATA"""
HKEY_PERFORMANCE_NLSTEXT = "HKEY_PERFORMANCE_NLSTEXT"
- #: HKEY_PERFORMANCE_TEXT
+ """HKEY_PERFORMANCE_NLSTEXT"""
HKEY_PERFORMANCE_TEXT = "HKEY_PERFORMANCE_TEXT"
- #: HKEY_A
+ """HKEY_PERFORMANCE_TEXT"""
HKEY_A = "HKEY_A"
- #: HKEY_CURRENT_USER
+ """HKEY_A"""
HKEY_CURRENT_USER = "HKEY_CURRENT_USER"
+ """HKEY_CURRENT_USER"""
class RegistryValueKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1161,61 +937,64 @@ class RegistryValueKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
type of a value in the registry.
"""
- #: None
NONE = "None"
- #: Unknown value type
+ """None"""
UNKNOWN = "Unknown"
- #: String value type
+ """Unknown value type"""
STRING = "String"
- #: ExpandString value type
+ """String value type"""
EXPAND_STRING = "ExpandString"
- #: Binary value type
+ """ExpandString value type"""
BINARY = "Binary"
- #: DWord value type
+ """Binary value type"""
D_WORD = "DWord"
- #: MultiString value type
+ """DWord value type"""
MULTI_STRING = "MultiString"
- #: QWord value type
+ """MultiString value type"""
Q_WORD = "QWord"
+ """QWord value type"""
+
+
+class RepositoryAccessKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of repository access credentials."""
+
+ O_AUTH = "OAuth"
+ PAT = "PAT"
+ APP = "App"
class RepoType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of repository."""
GITHUB = "Github"
- DEV_OPS = "DevOps"
+ AZURE_DEV_OPS = "AzureDevOps"
-class SecurityMLAnalyticsSettingsKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of security ML analytics settings."""
+class RestApiPollerRequestPagingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of paging."""
- ANOMALY = "Anomaly"
+ LINK_HEADER = "LinkHeader"
+ NEXT_PAGE_TOKEN = "NextPageToken"
+ NEXT_PAGE_URL = "NextPageUrl"
+ PERSISTENT_TOKEN = "PersistentToken"
+ PERSISTENT_LINK_HEADER = "PersistentLinkHeader"
+ OFFSET = "Offset"
+ COUNT_BASED_PAGING = "CountBasedPaging"
-class SettingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the setting."""
+class SecurityMLAnalyticsSettingsKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of security ML analytics settings."""
- ANOMALIES = "Anomalies"
- EYES_ON = "EyesOn"
- ENTITY_ANALYTICS = "EntityAnalytics"
- UEBA = "Ueba"
+ ANOMALY = "Anomaly"
class SettingsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The anomaly SecurityMLAnalyticsSettings status."""
- #: Anomaly settings status in Production mode
PRODUCTION = "Production"
- #: Anomaly settings status in Flighting mode
+ """Anomaly settings status in Production mode"""
FLIGHTING = "Flighting"
-
-
-class SettingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the setting."""
-
- COPYABLE_LABEL = "CopyableLabel"
- INSTRUCTION_STEPS_GROUP = "InstructionStepsGroup"
- INFO_MESSAGE = "InfoMessage"
+ """Anomaly settings status in Flighting mode"""
class SourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1231,22 +1010,16 @@ class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The sourceType of the watchlist."""
LOCAL_FILE = "Local file"
+ """The source from local file."""
REMOTE_STORAGE = "Remote storage"
+ """The source from remote storage."""
class State(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """State of recommendation."""
+ """Status of the pull request."""
- #: Recommendation is active.
- ACTIVE = "Active"
- #: Recommendation is disabled.
- DISABLED = "Disabled"
- #: Recommendation has been completed by user.
- COMPLETED_BY_USER = "CompletedByUser"
- #: Recommendation has been completed by action.
- COMPLETED_BY_ACTION = "CompletedByAction"
- #: Recommendation is hidden.
- HIDDEN = "Hidden"
+ OPEN = "Open"
+ CLOSED = "Closed"
class SupportTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1260,22 +1033,22 @@ class SupportTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class TemplateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The alert rule template status."""
- #: Alert rule template installed. and can not use more then once
INSTALLED = "Installed"
- #: Alert rule template is available.
+ """Alert rule template installed. and can not use more then once"""
AVAILABLE = "Available"
- #: Alert rule template is not available
+ """Alert rule template is available."""
NOT_AVAILABLE = "NotAvailable"
+ """Alert rule template is not available"""
-class ThreatIntelligenceResourceKindEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+class ThreatIntelligenceResourceInnerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The kind of the threat intelligence entity."""
- #: Entity represents threat intelligence indicator in the system.
INDICATOR = "indicator"
+ """Entity represents threat intelligence indicator in the system."""
-class ThreatIntelligenceSortingCriteriaEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+class ThreatIntelligenceSortingOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Sorting order (ascending/descending/unsorted)."""
UNSORTED = "unsorted"
@@ -1295,28 +1068,19 @@ class TriggerOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class TriggersOn(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""TriggersOn."""
- #: Trigger on Incidents
INCIDENTS = "Incidents"
- #: Trigger on Alerts
+ """Trigger on Incidents"""
ALERTS = "Alerts"
+ """Trigger on Alerts"""
class TriggersWhen(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""TriggersWhen."""
- #: Trigger on created objects
CREATED = "Created"
- #: Trigger on updated objects
+ """Trigger on created objects"""
UPDATED = "Updated"
-
-
-class UebaDataSources(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The data source that enriched by ueba."""
-
- AUDIT_LOGS = "AuditLogs"
- AZURE_ACTIVITY = "AzureActivity"
- SECURITY_EVENT = "SecurityEvent"
- SIGNIN_LOGS = "SigninLogs"
+ """Trigger on updated objects"""
class Version(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -1324,3 +1088,15 @@ class Version(str, Enum, metaclass=CaseInsensitiveEnumMeta):
V1 = "V1"
V2 = "V2"
+
+
+class WarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of repository."""
+
+ SOURCE_CONTROL_WARNING_DELETE_SERVICE_PRINCIPAL = "SourceControlWarning_DeleteServicePrincipal"
+ SOURCE_CONTROL_WARNING_DELETE_PIPELINE_FROM_AZURE_DEV_OPS = "SourceControlWarning_DeletePipelineFromAzureDevOps"
+ SOURCE_CONTROL_WARNING_DELETE_WORKFLOW_AND_SECRET_FROM_GIT_HUB = (
+ "SourceControlWarning_DeleteWorkflowAndSecretFromGitHub"
+ )
+ SOURCE_CONTROL_WARNING_DELETE_ROLE_ASSIGNMENT = "SourceControlWarning_DeleteRoleAssignment"
+ SOURCE_CONTROL_DELETED_WITH_WARNINGS = "SourceControl_DeletedWithWarnings"
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py
index 802d895ef601..6d97243ca023 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py
@@ -5,48 +5,47 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._alert_rules_operations import AlertRulesOperations
-from ._actions_operations import ActionsOperations
-from ._alert_rule_templates_operations import AlertRuleTemplatesOperations
-from ._automation_rules_operations import AutomationRulesOperations
-from ._incidents_operations import IncidentsOperations
-from ._bookmarks_operations import BookmarksOperations
-from ._bookmark_relations_operations import BookmarkRelationsOperations
-from ._bookmark_operations import BookmarkOperations
-from ._ip_geodata_operations import IPGeodataOperations
-from ._domain_whois_operations import DomainWhoisOperations
-from ._entities_operations import EntitiesOperations
-from ._entities_get_timeline_operations import EntitiesGetTimelineOperations
-from ._entities_relations_operations import EntitiesRelationsOperations
-from ._entity_relations_operations import EntityRelationsOperations
-from ._entity_queries_operations import EntityQueriesOperations
-from ._entity_query_templates_operations import EntityQueryTemplatesOperations
-from ._file_imports_operations import FileImportsOperations
-from ._incident_comments_operations import IncidentCommentsOperations
-from ._incident_relations_operations import IncidentRelationsOperations
-from ._incident_tasks_operations import IncidentTasksOperations
-from ._metadata_operations import MetadataOperations
-from ._office_consents_operations import OfficeConsentsOperations
-from ._sentinel_onboarding_states_operations import SentinelOnboardingStatesOperations
-from ._get_recommendations_operations import GetRecommendationsOperations
-from ._get_operations import GetOperations
-from ._update_operations import UpdateOperations
-from ._security_ml_analytics_settings_operations import SecurityMLAnalyticsSettingsOperations
-from ._product_settings_operations import ProductSettingsOperations
-from ._source_control_operations import SourceControlOperations
-from ._source_controls_operations import SourceControlsOperations
-from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations
-from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations
-from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations
-from ._watchlists_operations import WatchlistsOperations
-from ._watchlist_items_operations import WatchlistItemsOperations
-from ._data_connectors_operations import DataConnectorsOperations
-from ._data_connectors_check_requirements_operations import DataConnectorsCheckRequirementsOperations
-from ._operations import Operations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._alert_rules_operations import AlertRulesOperations # type: ignore
+from ._actions_operations import ActionsOperations # type: ignore
+from ._alert_rule_templates_operations import AlertRuleTemplatesOperations # type: ignore
+from ._automation_rules_operations import AutomationRulesOperations # type: ignore
+from ._entities_operations import EntitiesOperations # type: ignore
+from ._incidents_operations import IncidentsOperations # type: ignore
+from ._bookmarks_operations import BookmarksOperations # type: ignore
+from ._content_packages_operations import ContentPackagesOperations # type: ignore
+from ._content_package_operations import ContentPackageOperations # type: ignore
+from ._product_packages_operations import ProductPackagesOperations # type: ignore
+from ._product_package_operations import ProductPackageOperations # type: ignore
+from ._product_templates_operations import ProductTemplatesOperations # type: ignore
+from ._product_template_operations import ProductTemplateOperations # type: ignore
+from ._content_templates_operations import ContentTemplatesOperations # type: ignore
+from ._content_template_operations import ContentTemplateOperations # type: ignore
+from ._data_connector_definitions_operations import DataConnectorDefinitionsOperations # type: ignore
+from ._data_connectors_operations import DataConnectorsOperations # type: ignore
+from ._incident_comments_operations import IncidentCommentsOperations # type: ignore
+from ._incident_relations_operations import IncidentRelationsOperations # type: ignore
+from ._incident_tasks_operations import IncidentTasksOperations # type: ignore
+from ._metadata_operations import MetadataOperations # type: ignore
+from ._sentinel_onboarding_states_operations import SentinelOnboardingStatesOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._security_ml_analytics_settings_operations import SecurityMLAnalyticsSettingsOperations # type: ignore
+from ._source_control_operations import SourceControlOperations # type: ignore
+from ._source_controls_operations import SourceControlsOperations # type: ignore
+from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations # type: ignore
+from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations # type: ignore
+from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations # type: ignore
+from ._watchlists_operations import WatchlistsOperations # type: ignore
+from ._watchlist_items_operations import WatchlistItemsOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -54,30 +53,26 @@
"ActionsOperations",
"AlertRuleTemplatesOperations",
"AutomationRulesOperations",
+ "EntitiesOperations",
"IncidentsOperations",
"BookmarksOperations",
- "BookmarkRelationsOperations",
- "BookmarkOperations",
- "IPGeodataOperations",
- "DomainWhoisOperations",
- "EntitiesOperations",
- "EntitiesGetTimelineOperations",
- "EntitiesRelationsOperations",
- "EntityRelationsOperations",
- "EntityQueriesOperations",
- "EntityQueryTemplatesOperations",
- "FileImportsOperations",
+ "ContentPackagesOperations",
+ "ContentPackageOperations",
+ "ProductPackagesOperations",
+ "ProductPackageOperations",
+ "ProductTemplatesOperations",
+ "ProductTemplateOperations",
+ "ContentTemplatesOperations",
+ "ContentTemplateOperations",
+ "DataConnectorDefinitionsOperations",
+ "DataConnectorsOperations",
"IncidentCommentsOperations",
"IncidentRelationsOperations",
"IncidentTasksOperations",
"MetadataOperations",
- "OfficeConsentsOperations",
"SentinelOnboardingStatesOperations",
- "GetRecommendationsOperations",
- "GetOperations",
- "UpdateOperations",
+ "Operations",
"SecurityMLAnalyticsSettingsOperations",
- "ProductSettingsOperations",
"SourceControlOperations",
"SourceControlsOperations",
"ThreatIntelligenceIndicatorOperations",
@@ -85,9 +80,6 @@
"ThreatIntelligenceIndicatorMetricsOperations",
"WatchlistsOperations",
"WatchlistItemsOperations",
- "DataConnectorsOperations",
- "DataConnectorsCheckRequirementsOperations",
- "Operations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_actions_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_actions_operations.py
index a26c034dbc69..c502e5c159cd 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_actions_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_actions_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_by_alert_rule_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_by_alert_rule_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -73,7 +69,7 @@ def build_list_by_alert_rule_request(
"ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -90,9 +86,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -101,7 +95,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -117,7 +111,7 @@ def build_get_request(
"actionId": _SERIALIZER.url("action_id", action_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -134,9 +128,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -146,7 +138,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -162,7 +154,7 @@ def build_create_or_update_request(
"actionId": _SERIALIZER.url("action_id", action_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -181,9 +173,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -192,7 +182,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -208,7 +198,7 @@ def build_delete_request(
"actionId": _SERIALIZER.url("action_id", action_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -251,7 +241,6 @@ def list_by_alert_rule(
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ActionResponse or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.ActionResponse]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -259,12 +248,10 @@ def list_by_alert_rule(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ActionsList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -275,18 +262,16 @@ def list_by_alert_rule(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_by_alert_rule_request(
+ _request = build_list_by_alert_rule_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_by_alert_rule.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -298,13 +283,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ActionsList", pipeline_response)
@@ -314,10 +298,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -329,10 +314,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list_by_alert_rule.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
@@ -348,12 +329,11 @@ def get(
:type rule_id: str
:param action_id: Action ID. Required.
:type action_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -364,27 +344,24 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ActionResponse] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
action_id=action_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -393,16 +370,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ActionResponse", pipeline_response)
+ deserialized = self._deserialize("ActionResponse", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -432,7 +405,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
@@ -445,7 +417,7 @@ def create_or_update(
workspace_name: str,
rule_id: str,
action_id: str,
- action: IO,
+ action: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -462,11 +434,10 @@ def create_or_update(
:param action_id: Action ID. Required.
:type action_id: str
:param action: The action. Required.
- :type action: IO
+ :type action: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
@@ -479,7 +450,7 @@ def create_or_update(
workspace_name: str,
rule_id: str,
action_id: str,
- action: Union[_models.ActionRequest, IO],
+ action: Union[_models.ActionRequest, IO[bytes]],
**kwargs: Any
) -> _models.ActionResponse:
"""Creates or updates the action of alert rule.
@@ -493,17 +464,13 @@ def create_or_update(
:type rule_id: str
:param action_id: Action ID. Required.
:type action_id: str
- :param action: The action. Is either a model type or a IO type. Required.
- :type action: ~azure.mgmt.securityinsight.models.ActionRequest or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param action: The action. Is either a ActionRequest type or a IO[bytes] type. Required.
+ :type action: ~azure.mgmt.securityinsight.models.ActionRequest or IO[bytes]
:return: ActionResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ActionResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -514,21 +481,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ActionResponse] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(action, (IO, bytes)):
+ if isinstance(action, (IOBase, bytes)):
_content = action
else:
_json = self._serialize.body(action, "ActionRequest")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
@@ -538,15 +503,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -555,21 +519,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("ActionResponse", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("ActionResponse", pipeline_response)
+ deserialized = self._deserialize("ActionResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
@@ -585,12 +541,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type rule_id: str
:param action_id: Action ID. Required.
:type action_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -601,27 +556,24 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
action_id=action_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -631,8 +583,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_templates_operations.py
index 938d7e565001..b307289ce28f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_templates_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_templates_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,20 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +44,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +53,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -72,7 +67,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,9 +84,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +93,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -115,7 +108,7 @@ def build_get_request(
"alertRuleTemplateId": _SERIALIZER.url("alert_rule_template_id", alert_rule_template_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -156,7 +149,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AlertRuleTemplate or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -164,12 +156,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRuleTemplatesList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -180,17 +170,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -202,13 +190,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("AlertRuleTemplatesList", pipeline_response)
@@ -218,10 +205,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -233,10 +221,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, alert_rule_template_id: str, **kwargs: Any
@@ -250,12 +234,11 @@ def get(
:type workspace_name: str
:param alert_rule_template_id: Alert rule template ID. Required.
:type alert_rule_template_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRuleTemplate or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRuleTemplate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -266,26 +249,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRuleTemplate] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
alert_rule_template_id=alert_rule_template_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -294,13 +274,9 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AlertRuleTemplate", pipeline_response)
+ deserialized = self._deserialize("AlertRuleTemplate", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rules_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rules_operations.py
index 911942febd7a..d3703525cd07 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rules_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -72,7 +68,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,9 +85,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +94,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -115,7 +109,7 @@ def build_get_request(
"ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -132,9 +126,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -144,7 +136,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -159,7 +151,7 @@ def build_create_or_update_request(
"ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -178,9 +170,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -189,7 +179,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -204,7 +194,7 @@ def build_delete_request(
"ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -243,7 +233,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AlertRule or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.AlertRule]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -251,12 +240,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRulesList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -267,17 +254,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -289,13 +274,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("AlertRulesList", pipeline_response)
@@ -305,10 +289,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -320,10 +305,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules"
- }
-
@distributed_trace
def get(self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any) -> _models.AlertRule:
"""Gets the alert rule.
@@ -335,12 +316,11 @@ def get(self, resource_group_name: str, workspace_name: str, rule_id: str, **kwa
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -351,26 +331,23 @@ def get(self, resource_group_name: str, workspace_name: str, rule_id: str, **kwa
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AlertRule] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -379,16 +356,12 @@ def get(self, resource_group_name: str, workspace_name: str, rule_id: str, **kwa
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AlertRule", pipeline_response)
+ deserialized = self._deserialize("AlertRule", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -415,7 +388,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -427,7 +399,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
rule_id: str,
- alert_rule: IO,
+ alert_rule: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -442,11 +414,10 @@ def create_or_update(
:param rule_id: Alert rule ID. Required.
:type rule_id: str
:param alert_rule: The alert rule. Required.
- :type alert_rule: IO
+ :type alert_rule: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -458,7 +429,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
rule_id: str,
- alert_rule: Union[_models.AlertRule, IO],
+ alert_rule: Union[_models.AlertRule, IO[bytes]],
**kwargs: Any
) -> _models.AlertRule:
"""Creates or updates the alert rule.
@@ -470,17 +441,13 @@ def create_or_update(
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :param alert_rule: The alert rule. Is either a model type or a IO type. Required.
- :type alert_rule: ~azure.mgmt.securityinsight.models.AlertRule or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param alert_rule: The alert rule. Is either a AlertRule type or a IO[bytes] type. Required.
+ :type alert_rule: ~azure.mgmt.securityinsight.models.AlertRule or IO[bytes]
:return: AlertRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AlertRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -491,21 +458,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AlertRule] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(alert_rule, (IO, bytes)):
+ if isinstance(alert_rule, (IOBase, bytes)):
_content = alert_rule
else:
_json = self._serialize.body(alert_rule, "AlertRule")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
@@ -514,15 +479,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -531,21 +495,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("AlertRule", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("AlertRule", pipeline_response)
+ deserialized = self._deserialize("AlertRule", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any
@@ -559,12 +515,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param rule_id: Alert rule ID. Required.
:type rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,26 +530,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
rule_id=rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -604,8 +556,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_automation_rules_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_automation_rules_operations.py
index bb9e386f6773..c5bd10828268 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_automation_rules_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_automation_rules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,24 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,9 +46,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -63,7 +55,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -78,7 +70,7 @@ def build_get_request(
"automationRuleId": _SERIALIZER.url("automation_rule_id", automation_rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -95,9 +87,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -107,7 +97,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -122,7 +112,7 @@ def build_create_or_update_request(
"automationRuleId": _SERIALIZER.url("automation_rule_id", automation_rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -141,9 +131,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -152,7 +140,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -167,7 +155,7 @@ def build_delete_request(
"automationRuleId": _SERIALIZER.url("automation_rule_id", automation_rule_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -184,9 +172,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -195,7 +181,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -209,7 +195,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -252,12 +238,11 @@ def get(
:type workspace_name: str
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -268,26 +253,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AutomationRule] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
automation_rule_id=automation_rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -296,16 +278,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AutomationRule", pipeline_response)
+ deserialized = self._deserialize("AutomationRule", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -332,7 +310,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -344,7 +321,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
automation_rule_id: str,
- automation_rule_to_upsert: Optional[IO] = None,
+ automation_rule_to_upsert: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
@@ -359,11 +336,10 @@ def create_or_update(
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
:param automation_rule_to_upsert: The automation rule. Default value is None.
- :type automation_rule_to_upsert: IO
+ :type automation_rule_to_upsert: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
@@ -375,7 +351,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
automation_rule_id: str,
- automation_rule_to_upsert: Optional[Union[_models.AutomationRule, IO]] = None,
+ automation_rule_to_upsert: Optional[Union[_models.AutomationRule, IO[bytes]]] = None,
**kwargs: Any
) -> _models.AutomationRule:
"""Creates or updates the automation rule.
@@ -387,18 +363,14 @@ def create_or_update(
:type workspace_name: str
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
- :param automation_rule_to_upsert: The automation rule. Is either a model type or a IO type.
- Default value is None.
- :type automation_rule_to_upsert: ~azure.mgmt.securityinsight.models.AutomationRule or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param automation_rule_to_upsert: The automation rule. Is either a AutomationRule type or a
+ IO[bytes] type. Default value is None.
+ :type automation_rule_to_upsert: ~azure.mgmt.securityinsight.models.AutomationRule or IO[bytes]
:return: AutomationRule or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.AutomationRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -409,16 +381,14 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AutomationRule] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(automation_rule_to_upsert, (IO, bytes)):
+ if isinstance(automation_rule_to_upsert, (IOBase, bytes)):
_content = automation_rule_to_upsert
else:
if automation_rule_to_upsert is not None:
@@ -426,7 +396,7 @@ def create_or_update(
else:
_json = None
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
automation_rule_id=automation_rule_id,
@@ -435,15 +405,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -452,21 +421,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("AutomationRule", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("AutomationRule", pipeline_response)
+ deserialized = self._deserialize("AutomationRule", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
-
@distributed_trace
def delete(self, resource_group_name: str, workspace_name: str, automation_rule_id: str, **kwargs: Any) -> JSON:
"""Delete the automation rule.
@@ -478,12 +439,11 @@ def delete(self, resource_group_name: str, workspace_name: str, automation_rule_
:type workspace_name: str
:param automation_rule_id: Automation rule ID. Required.
:type automation_rule_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: JSON or the result of cls(response)
:rtype: JSON
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -494,26 +454,23 @@ def delete(self, resource_group_name: str, workspace_name: str, automation_rule_
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[JSON] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
automation_rule_id=automation_rule_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -522,21 +479,13 @@ def delete(self, resource_group_name: str, workspace_name: str, automation_rule_
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("object", pipeline_response)
-
- if response.status_code == 204:
- deserialized = self._deserialize("object", pipeline_response)
+ deserialized = self._deserialize("object", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
-
@distributed_trace
def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterable["_models.AutomationRule"]:
"""Gets all automation rules.
@@ -546,7 +495,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AutomationRule or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.AutomationRule]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -554,12 +502,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AutomationRulesList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -570,17 +516,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -592,13 +536,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("AutomationRulesList", pipeline_response)
@@ -608,10 +551,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -622,7 +566,3 @@ def get_next(next_link=None):
return pipeline_response
return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmark_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmark_operations.py
deleted file mode 100644
index 493b78b645ee..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmark_operations.py
+++ /dev/null
@@ -1,260 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_expand_request(
- resource_group_name: str, workspace_name: str, bookmark_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class BookmarkOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`bookmark` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @overload
- def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- parameters: _models.BookmarkExpandParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BookmarkExpandResponse:
- """Expand an bookmark.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param parameters: The parameters required to execute an expand operation on the given
- bookmark. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.BookmarkExpandParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: BookmarkExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.BookmarkExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- parameters: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BookmarkExpandResponse:
- """Expand an bookmark.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param parameters: The parameters required to execute an expand operation on the given
- bookmark. Required.
- :type parameters: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: BookmarkExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.BookmarkExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- parameters: Union[_models.BookmarkExpandParameters, IO],
- **kwargs: Any
- ) -> _models.BookmarkExpandResponse:
- """Expand an bookmark.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param parameters: The parameters required to execute an expand operation on the given
- bookmark. Is either a model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.BookmarkExpandParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: BookmarkExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.BookmarkExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.BookmarkExpandResponse] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "BookmarkExpandParameters")
-
- request = build_expand_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.expand.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("BookmarkExpandResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- expand.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmark_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmark_relations_operations.py
deleted file mode 100644
index ea17c2058589..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmark_relations_operations.py
+++ /dev/null
@@ -1,694 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
-import urllib.parse
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.paging import ItemPaged
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_list_request(
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- subscription_id: str,
- *,
- filter: Optional[str] = None,
- orderby: Optional[str] = None,
- top: Optional[int] = None,
- skip_token: Optional[str] = None,
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
- if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
- if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
- if top is not None:
- _params["$top"] = _SERIALIZER.query("top", top, "int")
- if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_get_request(
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- subscription_id: str,
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_create_or_update_request(
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- subscription_id: str,
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_delete_request(
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- subscription_id: str,
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class BookmarkRelationsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`bookmark_relations` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- filter: Optional[str] = None,
- orderby: Optional[str] = None,
- top: Optional[int] = None,
- skip_token: Optional[str] = None,
- **kwargs: Any
- ) -> Iterable["_models.Relation"]:
- """Gets all bookmark relations.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
- None.
- :type filter: str
- :param orderby: Sorts the results. Optional. Default value is None.
- :type orderby: str
- :param top: Returns only the first n results. Optional. Default value is None.
- :type top: int
- :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
- a previous response contains a nextLink element, the value of the nextLink element will include
- a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
- Default value is None.
- :type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either Relation or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Relation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- subscription_id=self._config.subscription_id,
- filter=filter,
- orderby=orderby,
- top=top,
- skip_token=skip_token,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- def extract_data(pipeline_response):
- deserialized = self._deserialize("RelationList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations"
- }
-
- @distributed_trace
- def get(
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, relation_name: str, **kwargs: Any
- ) -> _models.Relation:
- """Gets a bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}"
- }
-
- @overload
- def create_or_update(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- relation: _models.Relation,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Relation:
- """Creates the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :param relation: The relation model. Required.
- :type relation: ~azure.mgmt.securityinsight.models.Relation
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def create_or_update(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- relation: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Relation:
- """Creates the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :param relation: The relation model. Required.
- :type relation: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def create_or_update(
- self,
- resource_group_name: str,
- workspace_name: str,
- bookmark_id: str,
- relation_name: str,
- relation: Union[_models.Relation, IO],
- **kwargs: Any
- ) -> _models.Relation:
- """Creates the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :param relation: The relation model. Is either a model type or a IO type. Required.
- :type relation: ~azure.mgmt.securityinsight.models.Relation or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(relation, (IO, bytes)):
- _content = relation
- else:
- _json = self._serialize.body(relation, "Relation")
-
- request = build_create_or_update_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create_or_update.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if response.status_code == 200:
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}"
- }
-
- @distributed_trace
- def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, relation_name: str, **kwargs: Any
- ) -> None:
- """Delete the bookmark relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param bookmark_id: Bookmark ID. Required.
- :type bookmark_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- bookmark_id=bookmark_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.delete.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmarks_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmarks_operations.py
index 3f7b2f8ad3de..2b9f0dea80f4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmarks_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_bookmarks_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -72,7 +68,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,9 +85,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +94,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -115,7 +109,7 @@ def build_get_request(
"bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -132,9 +126,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -144,7 +136,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -159,7 +151,7 @@ def build_create_or_update_request(
"bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -178,9 +170,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -189,7 +179,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -204,7 +194,7 @@ def build_delete_request(
"bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -243,7 +233,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Bookmark or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Bookmark]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -251,12 +240,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BookmarkList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -267,17 +254,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -289,13 +274,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("BookmarkList", pipeline_response)
@@ -305,10 +289,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -320,10 +305,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks"
- }
-
@distributed_trace
def get(self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any) -> _models.Bookmark:
"""Gets a bookmark.
@@ -335,12 +316,11 @@ def get(self, resource_group_name: str, workspace_name: str, bookmark_id: str, *
:type workspace_name: str
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -351,26 +331,23 @@ def get(self, resource_group_name: str, workspace_name: str, bookmark_id: str, *
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Bookmark] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -379,16 +356,12 @@ def get(self, resource_group_name: str, workspace_name: str, bookmark_id: str, *
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Bookmark", pipeline_response)
+ deserialized = self._deserialize("Bookmark", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -415,7 +388,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
@@ -427,7 +399,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
bookmark_id: str,
- bookmark: IO,
+ bookmark: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -442,11 +414,10 @@ def create_or_update(
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
:param bookmark: The bookmark. Required.
- :type bookmark: IO
+ :type bookmark: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
@@ -458,7 +429,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
bookmark_id: str,
- bookmark: Union[_models.Bookmark, IO],
+ bookmark: Union[_models.Bookmark, IO[bytes]],
**kwargs: Any
) -> _models.Bookmark:
"""Creates or updates the bookmark.
@@ -470,17 +441,13 @@ def create_or_update(
:type workspace_name: str
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
- :param bookmark: The bookmark. Is either a model type or a IO type. Required.
- :type bookmark: ~azure.mgmt.securityinsight.models.Bookmark or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param bookmark: The bookmark. Is either a Bookmark type or a IO[bytes] type. Required.
+ :type bookmark: ~azure.mgmt.securityinsight.models.Bookmark or IO[bytes]
:return: Bookmark or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Bookmark
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -491,21 +458,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Bookmark] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(bookmark, (IO, bytes)):
+ if isinstance(bookmark, (IOBase, bytes)):
_content = bookmark
else:
_json = self._serialize.body(bookmark, "Bookmark")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
@@ -514,15 +479,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -531,21 +495,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("Bookmark", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Bookmark", pipeline_response)
+ deserialized = self._deserialize("Bookmark", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any
@@ -559,12 +515,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param bookmark_id: Bookmark ID. Required.
:type bookmark_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,26 +530,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -604,8 +556,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_package_operations.py
new file mode 100644
index 000000000000..7e92312dc6ab
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_package_operations.py
@@ -0,0 +1,339 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_install_request(
+ resource_group_name: str, workspace_name: str, package_id: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "workspaceName": _SERIALIZER.url(
+ "workspace_name",
+ workspace_name,
+ "str",
+ max_length=90,
+ min_length=1,
+ pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
+ ),
+ "packageId": _SERIALIZER.url("package_id", package_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_uninstall_request(
+ resource_group_name: str, workspace_name: str, package_id: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "workspaceName": _SERIALIZER.url(
+ "workspace_name",
+ workspace_name,
+ "str",
+ max_length=90,
+ min_length=1,
+ pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
+ ),
+ "packageId": _SERIALIZER.url("package_id", package_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class ContentPackageOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`content_package` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @overload
+ def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ package_id: str,
+ package_installation_properties: _models.PackageModel,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.PackageModel:
+ """Install a package to the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :param package_installation_properties: Package installation properties. Required.
+ :type package_installation_properties: ~azure.mgmt.securityinsight.models.PackageModel
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ package_id: str,
+ package_installation_properties: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.PackageModel:
+ """Install a package to the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :param package_installation_properties: Package installation properties. Required.
+ :type package_installation_properties: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ package_id: str,
+ package_installation_properties: Union[_models.PackageModel, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.PackageModel:
+ """Install a package to the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :param package_installation_properties: Package installation properties. Is either a
+ PackageModel type or a IO[bytes] type. Required.
+ :type package_installation_properties: ~azure.mgmt.securityinsight.models.PackageModel or
+ IO[bytes]
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.PackageModel] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(package_installation_properties, (IOBase, bytes)):
+ _content = package_installation_properties
+ else:
+ _json = self._serialize.body(package_installation_properties, "PackageModel")
+
+ _request = build_install_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ package_id=package_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("PackageModel", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def uninstall( # pylint: disable=inconsistent-return-statements
+ self, resource_group_name: str, workspace_name: str, package_id: str, **kwargs: Any
+ ) -> None:
+ """Uninstall a package from the workspace.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_uninstall_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ package_id=package_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_query_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_packages_operations.py
similarity index 61%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_query_templates_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_packages_operations.py
index cd961f94a317..8593af617f19 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_query_templates_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_packages_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -20,20 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,24 +43,28 @@ def build_list_request(
workspace_name: str,
subscription_id: str,
*,
- kind: Optional[Union[str, _models.Enum15]] = None,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -77,12 +78,24 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
- if kind is not None:
- _params["kind"] = _SERIALIZER.query("kind", kind, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if orderby is not None:
+ _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ if search is not None:
+ _params["$search"] = _SERIALIZER.query("search", search, "str")
+ if count is not None:
+ _params["$count"] = _SERIALIZER.query("count", count, "bool")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ if skip is not None:
+ _params["$skip"] = _SERIALIZER.query("skip", skip, "int")
+ if skip_token is not None:
+ _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -91,23 +104,21 @@ def build_list_request(
def build_get_request(
- resource_group_name: str, workspace_name: str, entity_query_template_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str, workspace_name: str, package_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -119,10 +130,10 @@ def build_get_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "entityQueryTemplateId": _SERIALIZER.url("entity_query_template_id", entity_query_template_id, "str"),
+ "packageId": _SERIALIZER.url("package_id", package_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -133,14 +144,14 @@ def build_get_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class EntityQueryTemplatesOperations:
+class ContentPackagesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`entity_query_templates` attribute.
+ :attr:`content_packages` attribute.
"""
models = _models
@@ -157,32 +168,53 @@ def list(
self,
resource_group_name: str,
workspace_name: str,
- kind: Optional[Union[str, _models.Enum15]] = None,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
**kwargs: Any
- ) -> Iterable["_models.EntityQueryTemplate"]:
- """Gets all entity query templates.
+ ) -> Iterable["_models.PackageModel"]:
+ """Gets all installed packages.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param kind: The entity template query kind we want to fetch. "Activity" Default value is None.
- :type kind: str or ~azure.mgmt.securityinsight.models.Enum15
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either EntityQueryTemplate or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: str
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :param count: Instructs the server to return only object count without actual body. Optional.
+ Default value is None.
+ :type count: bool
+ :param top: Returns only the first n results. Optional. Default value is None.
+ :type top: int
+ :param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
+ next page of results if there are any left. Default value is None.
+ :type skip: int
+ :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
+ a previous response contains a nextLink element, the value of the nextLink element will include
+ a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
+ Default value is None.
+ :type skip_token: str
+ :return: An iterator like instance of either PackageModel or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.PackageModel]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQueryTemplateList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.PackageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -193,18 +225,22 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
- kind=kind,
+ filter=filter,
+ orderby=orderby,
+ search=search,
+ count=count,
+ top=top,
+ skip=skip,
+ skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -216,26 +252,26 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
- deserialized = self._deserialize("EntityQueryTemplateList", pipeline_response)
+ deserialized = self._deserialize("PackageList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -247,29 +283,24 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates"
- }
-
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, entity_query_template_id: str, **kwargs: Any
- ) -> _models.EntityQueryTemplate:
- """Gets an entity query.
+ self, resource_group_name: str, workspace_name: str, package_id: str, **kwargs: Any
+ ) -> _models.PackageModel:
+ """Gets an installed packages by its id.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_template_id: entity query template ID. Required.
- :type entity_query_template_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQueryTemplate or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQueryTemplate
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :return: PackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.PackageModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -280,26 +311,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQueryTemplate] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.PackageModel] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_template_id=entity_query_template_id,
+ package_id=package_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -308,13 +336,9 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EntityQueryTemplate", pipeline_response)
+ deserialized = self._deserialize("PackageModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_office_consents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_template_operations.py
similarity index 50%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_office_consents_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_template_operations.py
index 6c185d8b07ac..5aa8bbf3f259 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_office_consents_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_template_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,9 +5,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
-import urllib.parse
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -18,22 +17,19 @@
ResourceNotModifiedError,
map_error,
)
-from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,24 +37,23 @@
_SERIALIZER.client_side_validation = False
-def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
+def build_install_request(
+ resource_group_name: str, workspace_name: str, template_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -70,37 +65,38 @@ def build_list_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
+ "templateId": _SERIALIZER.url("template_id", template_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
def build_get_request(
- resource_group_name: str, workspace_name: str, consent_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str, workspace_name: str, template_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -112,10 +108,10 @@ def build_get_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "consentId": _SERIALIZER.url("consent_id", consent_id, "str"),
+ "templateId": _SERIALIZER.url("template_id", template_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -127,23 +123,21 @@ def build_get_request(
def build_delete_request(
- resource_group_name: str, workspace_name: str, consent_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str, workspace_name: str, template_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -155,10 +149,10 @@ def build_delete_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "consentId": _SERIALIZER.url("consent_id", consent_id, "str"),
+ "templateId": _SERIALIZER.url("template_id", template_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -169,14 +163,14 @@ def build_delete_request(
return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-class OfficeConsentsOperations:
+class ContentTemplateOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`office_consents` attribute.
+ :attr:`content_template` attribute.
"""
models = _models
@@ -188,29 +182,93 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- @distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterable["_models.OfficeConsent"]:
- """Gets all office365 consents.
+ @overload
+ def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ template_id: str,
+ template_installation_properties: _models.TemplateModel,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Install a template.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either OfficeConsent or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.OfficeConsent]
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :param template_installation_properties: Template installation properties. Required.
+ :type template_installation_properties: ~azure.mgmt.securityinsight.models.TemplateModel
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.OfficeConsentList] = kwargs.pop("cls", None)
+ @overload
+ def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ template_id: str,
+ template_installation_properties: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Install a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :param template_installation_properties: Template installation properties. Required.
+ :type template_installation_properties: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
- error_map = {
+ @distributed_trace
+ def install(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ template_id: str,
+ template_installation_properties: Union[_models.TemplateModel, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Install a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :param template_installation_properties: Template installation properties. Is either a
+ TemplateModel type or a IO[bytes] type. Required.
+ :type template_installation_properties: ~azure.mgmt.securityinsight.models.TemplateModel or
+ IO[bytes]
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -218,85 +276,76 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
}
error_map.update(kwargs.pop("error_map", {}) or {})
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- def extract_data(pipeline_response):
- deserialized = self._deserialize("OfficeConsentList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents"
- }
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.TemplateModel] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(template_installation_properties, (IOBase, bytes)):
+ _content = template_installation_properties
+ else:
+ _json = self._serialize.body(template_installation_properties, "TemplateModel")
+
+ _request = build_install_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ template_id=template_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TemplateModel", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, consent_id: str, **kwargs: Any
- ) -> _models.OfficeConsent:
- """Gets an office365 consent.
+ self, resource_group_name: str, workspace_name: str, template_id: str, **kwargs: Any
+ ) -> _models.TemplateModel:
+ """Gets a template byt its identifier.
+ Expandable properties:
+
+
+ * properties/mainTemplate
+ * properties/dependantTemplates.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param consent_id: consent ID. Required.
- :type consent_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: OfficeConsent or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.OfficeConsent
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :return: TemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TemplateModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -307,26 +356,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.OfficeConsent] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.TemplateModel] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- consent_id=consent_id,
+ template_id=template_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -335,36 +381,31 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OfficeConsent", pipeline_response)
+ deserialized = self._deserialize("TemplateModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}"
- }
+ return deserialized # type: ignore
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, consent_id: str, **kwargs: Any
+ self, resource_group_name: str, workspace_name: str, template_id: str, **kwargs: Any
) -> None:
- """Delete the office365 consent.
+ """Delete an installed template.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param consent_id: consent ID. Required.
- :type consent_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param template_id: template Id. Required.
+ :type template_id: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -375,26 +416,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- consent_id=consent_id,
+ template_id=template_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -404,8 +442,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_templates_operations.py
new file mode 100644
index 000000000000..3df21d3a8a9e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_templates_operations.py
@@ -0,0 +1,256 @@
+# 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 sys
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_list_request(
+ resource_group_name: str,
+ workspace_name: str,
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ expand: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "workspaceName": _SERIALIZER.url(
+ "workspace_name",
+ workspace_name,
+ "str",
+ max_length=90,
+ min_length=1,
+ pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if orderby is not None:
+ _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ if search is not None:
+ _params["$search"] = _SERIALIZER.query("search", search, "str")
+ if count is not None:
+ _params["$count"] = _SERIALIZER.query("count", count, "bool")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ if skip is not None:
+ _params["$skip"] = _SERIALIZER.query("skip", skip, "int")
+ if skip_token is not None:
+ _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class ContentTemplatesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`content_templates` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ expand: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.TemplateModel"]:
+ """Gets all installed templates.
+ Expandable properties:
+
+
+ * properties/mainTemplate
+ * properties/dependantTemplates.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: str
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
+ :param expand: Expands the object with optional fiends that are not included by default.
+ Optional. Default value is None.
+ :type expand: str
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :param count: Instructs the server to return only object count without actual body. Optional.
+ Default value is None.
+ :type count: bool
+ :param top: Returns only the first n results. Optional. Default value is None.
+ :type top: int
+ :param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
+ next page of results if there are any left. Default value is None.
+ :type skip: int
+ :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
+ a previous response contains a nextLink element, the value of the nextLink element will include
+ a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
+ Default value is None.
+ :type skip_token: str
+ :return: An iterator like instance of either TemplateModel or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.TemplateModel]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.TemplateList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ expand=expand,
+ search=search,
+ count=count,
+ top=top,
+ skip=skip,
+ skip_token=skip_token,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("TemplateList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_queries_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connector_definitions_operations.py
similarity index 61%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_queries_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connector_definitions_operations.py
index 89f9d636c466..7b44704abb3d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_queries_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connector_definitions_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,28 +40,21 @@
def build_list_request(
- resource_group_name: str,
- workspace_name: str,
- subscription_id: str,
- *,
- kind: Optional[Union[str, _models.Enum13]] = None,
- **kwargs: Any
+ resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -77,11 +68,9 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
- if kind is not None:
- _params["kind"] = _SERIALIZER.query("kind", kind, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -91,23 +80,25 @@ def build_list_request(
def build_get_request(
- resource_group_name: str, workspace_name: str, entity_query_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ subscription_id: str,
+ **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -119,10 +110,12 @@ def build_get_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_id, "str"),
+ "dataConnectorDefinitionName": _SERIALIZER.url(
+ "data_connector_definition_name", data_connector_definition_name, "str", pattern=r"^[a-z0-9A-Z-_]*$"
+ ),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -134,24 +127,26 @@ def build_get_request(
def build_create_or_update_request(
- resource_group_name: str, workspace_name: str, entity_query_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ subscription_id: str,
+ **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -163,10 +158,12 @@ def build_create_or_update_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_id, "str"),
+ "dataConnectorDefinitionName": _SERIALIZER.url(
+ "data_connector_definition_name", data_connector_definition_name, "str", pattern=r"^[a-z0-9A-Z-_]*$"
+ ),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -180,23 +177,25 @@ def build_create_or_update_request(
def build_delete_request(
- resource_group_name: str, workspace_name: str, entity_query_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ subscription_id: str,
+ **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -208,10 +207,12 @@ def build_delete_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_id, "str"),
+ "dataConnectorDefinitionName": _SERIALIZER.url(
+ "data_connector_definition_name", data_connector_definition_name, "str", pattern=r"^[a-z0-9A-Z-_]*$"
+ ),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -222,14 +223,14 @@ def build_delete_request(
return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-class EntityQueriesOperations:
+class DataConnectorDefinitionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`entity_queries` attribute.
+ :attr:`data_connector_definitions` attribute.
"""
models = _models
@@ -243,36 +244,28 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- kind: Optional[Union[str, _models.Enum13]] = None,
- **kwargs: Any
- ) -> Iterable["_models.EntityQuery"]:
- """Gets all entity queries.
+ self, resource_group_name: str, workspace_name: str, **kwargs: Any
+ ) -> Iterable["_models.DataConnectorDefinition"]:
+ """Gets all data connector definitions.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param kind: The entity query kind we want to fetch. Known values are: "Expansion" and
- "Activity". Default value is None.
- :type kind: str or ~azure.mgmt.securityinsight.models.Enum13
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either EntityQuery or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.EntityQuery]
+ :return: An iterator like instance of either DataConnectorDefinition or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.DataConnectorDefinition]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQueryList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.DataConnectorDefinitionArmCollectionWrapper] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -283,18 +276,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
- kind=kind,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -306,26 +296,26 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
- deserialized = self._deserialize("EntityQueryList", pipeline_response)
+ deserialized = self._deserialize("DataConnectorDefinitionArmCollectionWrapper", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -337,29 +327,24 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries"
- }
-
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, entity_query_id: str, **kwargs: Any
- ) -> _models.EntityQuery:
- """Gets an entity query.
+ self, resource_group_name: str, workspace_name: str, data_connector_definition_name: str, **kwargs: Any
+ ) -> _models.DataConnectorDefinition:
+ """Gets a data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -370,26 +355,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityQuery] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.DataConnectorDefinition] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_id=entity_query_id,
+ data_connector_definition_name=data_connector_definition_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -398,45 +380,40 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EntityQuery", pipeline_response)
+ deserialized = self._deserialize("DataConnectorDefinition", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
- entity_query_id: str,
- entity_query: _models.CustomEntityQuery,
+ data_connector_definition_name: str,
+ connector_definition_input: _models.DataConnectorDefinition,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityQuery:
- """Creates or updates the entity query.
+ ) -> _models.DataConnectorDefinition:
+ """Creates or updates the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :param entity_query: The entity query we want to create or update. Required.
- :type entity_query: ~azure.mgmt.securityinsight.models.CustomEntityQuery
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :param connector_definition_input: The data connector definition. Required.
+ :type connector_definition_input: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -445,29 +422,28 @@ def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
- entity_query_id: str,
- entity_query: IO,
+ data_connector_definition_name: str,
+ connector_definition_input: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityQuery:
- """Creates or updates the entity query.
+ ) -> _models.DataConnectorDefinition:
+ """Creates or updates the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :param entity_query: The entity query we want to create or update. Required.
- :type entity_query: IO
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :param connector_definition_input: The data connector definition. Required.
+ :type connector_definition_input: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -476,31 +452,28 @@ def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
- entity_query_id: str,
- entity_query: Union[_models.CustomEntityQuery, IO],
+ data_connector_definition_name: str,
+ connector_definition_input: Union[_models.DataConnectorDefinition, IO[bytes]],
**kwargs: Any
- ) -> _models.EntityQuery:
- """Creates or updates the entity query.
+ ) -> _models.DataConnectorDefinition:
+ """Creates or updates the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :param entity_query: The entity query we want to create or update. Is either a model type or a
- IO type. Required.
- :type entity_query: ~azure.mgmt.securityinsight.models.CustomEntityQuery or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityQuery or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityQuery
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
+ :param connector_definition_input: The data connector definition. Is either a
+ DataConnectorDefinition type or a IO[bytes] type. Required.
+ :type connector_definition_input: ~azure.mgmt.securityinsight.models.DataConnectorDefinition or
+ IO[bytes]
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -511,38 +484,35 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityQuery] = kwargs.pop("cls", None)
+ cls: ClsType[_models.DataConnectorDefinition] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(entity_query, (IO, bytes)):
- _content = entity_query
+ if isinstance(connector_definition_input, (IOBase, bytes)):
+ _content = connector_definition_input
else:
- _json = self._serialize.body(entity_query, "CustomEntityQuery")
+ _json = self._serialize.body(connector_definition_input, "DataConnectorDefinition")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_id=entity_query_id,
+ data_connector_definition_name=data_connector_definition_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -551,40 +521,31 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("EntityQuery", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("EntityQuery", pipeline_response)
+ deserialized = self._deserialize("DataConnectorDefinition", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, entity_query_id: str, **kwargs: Any
+ self, resource_group_name: str, workspace_name: str, data_connector_definition_name: str, **kwargs: Any
) -> None:
- """Delete the entity query.
+ """Delete the data connector definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_query_id: entity query ID. Required.
- :type entity_query_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param data_connector_definition_name: The data connector definition name. Required.
+ :type data_connector_definition_name: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -595,26 +556,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_query_id=entity_query_id,
+ data_connector_definition_name=data_connector_definition_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -624,8 +582,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_check_requirements_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_check_requirements_operations.py
deleted file mode 100644
index a443aede96d7..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_check_requirements_operations.py
+++ /dev/null
@@ -1,251 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_post_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class DataConnectorsCheckRequirementsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`data_connectors_check_requirements` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @overload
- def post(
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connectors_check_requirements: _models.DataConnectorsCheckRequirements,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.DataConnectorRequirementsState:
- """Get requirements state for a data connector type.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connectors_check_requirements: The parameters for requirements check message.
- Required.
- :type data_connectors_check_requirements:
- ~azure.mgmt.securityinsight.models.DataConnectorsCheckRequirements
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: DataConnectorRequirementsState or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.DataConnectorRequirementsState
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def post(
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connectors_check_requirements: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.DataConnectorRequirementsState:
- """Get requirements state for a data connector type.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connectors_check_requirements: The parameters for requirements check message.
- Required.
- :type data_connectors_check_requirements: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: DataConnectorRequirementsState or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.DataConnectorRequirementsState
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def post(
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connectors_check_requirements: Union[_models.DataConnectorsCheckRequirements, IO],
- **kwargs: Any
- ) -> _models.DataConnectorRequirementsState:
- """Get requirements state for a data connector type.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connectors_check_requirements: The parameters for requirements check message. Is
- either a model type or a IO type. Required.
- :type data_connectors_check_requirements:
- ~azure.mgmt.securityinsight.models.DataConnectorsCheckRequirements or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: DataConnectorRequirementsState or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.DataConnectorRequirementsState
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.DataConnectorRequirementsState] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(data_connectors_check_requirements, (IO, bytes)):
- _content = data_connectors_check_requirements
- else:
- _json = self._serialize.body(data_connectors_check_requirements, "DataConnectorsCheckRequirements")
-
- request = build_post_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.post.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("DataConnectorRequirementsState", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- post.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_operations.py
index d0adeeadb0c8..6c361a18866b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -72,7 +68,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,9 +85,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +94,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -115,7 +109,7 @@ def build_get_request(
"dataConnectorId": _SERIALIZER.url("data_connector_id", data_connector_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -132,9 +126,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -144,7 +136,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -159,7 +151,7 @@ def build_create_or_update_request(
"dataConnectorId": _SERIALIZER.url("data_connector_id", data_connector_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -178,9 +170,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -189,7 +179,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -204,7 +194,7 @@ def build_delete_request(
"dataConnectorId": _SERIALIZER.url("data_connector_id", data_connector_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -215,95 +205,6 @@ def build_delete_request(
return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-def build_connect_request(
- resource_group_name: str, workspace_name: str, data_connector_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "dataConnectorId": _SERIALIZER.url("data_connector_id", data_connector_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_disconnect_request(
- resource_group_name: str, workspace_name: str, data_connector_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "dataConnectorId": _SERIALIZER.url("data_connector_id", data_connector_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
class DataConnectorsOperations:
"""
.. warning::
@@ -332,7 +233,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DataConnector or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.DataConnector]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -340,12 +240,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DataConnectorList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -356,17 +254,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -378,13 +274,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("DataConnectorList", pipeline_response)
@@ -394,10 +289,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -409,10 +305,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
@@ -426,12 +318,11 @@ def get(
:type workspace_name: str
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -442,26 +333,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DataConnector] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -470,16 +358,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("DataConnector", pipeline_response)
+ deserialized = self._deserialize("DataConnector", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -506,7 +390,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
@@ -518,7 +401,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
data_connector_id: str,
- data_connector: IO,
+ data_connector: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -533,11 +416,10 @@ def create_or_update(
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
:param data_connector: The data connector. Required.
- :type data_connector: IO
+ :type data_connector: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
@@ -549,7 +431,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
data_connector_id: str,
- data_connector: Union[_models.DataConnector, IO],
+ data_connector: Union[_models.DataConnector, IO[bytes]],
**kwargs: Any
) -> _models.DataConnector:
"""Creates or updates the data connector.
@@ -561,17 +443,14 @@ def create_or_update(
:type workspace_name: str
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
- :param data_connector: The data connector. Is either a model type or a IO type. Required.
- :type data_connector: ~azure.mgmt.securityinsight.models.DataConnector or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param data_connector: The data connector. Is either a DataConnector type or a IO[bytes] type.
+ Required.
+ :type data_connector: ~azure.mgmt.securityinsight.models.DataConnector or IO[bytes]
:return: DataConnector or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.DataConnector
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -582,21 +461,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DataConnector] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(data_connector, (IO, bytes)):
+ if isinstance(data_connector, (IOBase, bytes)):
_content = data_connector
else:
_json = self._serialize.body(data_connector, "DataConnector")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
@@ -605,15 +482,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -622,21 +498,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("DataConnector", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("DataConnector", pipeline_response)
+ deserialized = self._deserialize("DataConnector", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
@@ -650,12 +518,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -666,26 +533,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -695,220 +559,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
-
- @overload
- def connect( # pylint: disable=inconsistent-return-statements
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connector_id: str,
- connect_body: _models.DataConnectorConnectBody,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> None:
- """Connects a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :param connect_body: The data connector. Required.
- :type connect_body: ~azure.mgmt.securityinsight.models.DataConnectorConnectBody
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def connect( # pylint: disable=inconsistent-return-statements
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connector_id: str,
- connect_body: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> None:
- """Connects a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :param connect_body: The data connector. Required.
- :type connect_body: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def connect( # pylint: disable=inconsistent-return-statements
- self,
- resource_group_name: str,
- workspace_name: str,
- data_connector_id: str,
- connect_body: Union[_models.DataConnectorConnectBody, IO],
- **kwargs: Any
- ) -> None:
- """Connects a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :param connect_body: The data connector. Is either a model type or a IO type. Required.
- :type connect_body: ~azure.mgmt.securityinsight.models.DataConnectorConnectBody or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(connect_body, (IO, bytes)):
- _content = connect_body
- else:
- _json = self._serialize.body(connect_body, "DataConnectorConnectBody")
-
- request = build_connect_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- data_connector_id=data_connector_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.connect.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- connect.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect"
- }
-
- @distributed_trace
- def disconnect( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
- ) -> None:
- """Disconnect a data connector.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param data_connector_id: Connector ID. Required.
- :type data_connector_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_disconnect_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- data_connector_id=data_connector_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.disconnect.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- disconnect.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_domain_whois_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_domain_whois_operations.py
deleted file mode 100644
index ce39a050336d..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_domain_whois_operations.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, Optional, TypeVar
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_get_request(resource_group_name: str, subscription_id: str, *, domain: str, **kwargs: Any) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
- _params["domain"] = _SERIALIZER.query("domain", domain, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class DomainWhoisOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`domain_whois` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def get(self, resource_group_name: str, domain: str, **kwargs: Any) -> _models.EnrichmentDomainWhois:
- """Get whois information for a single domain name.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param domain: Domain name to be enriched. Required.
- :type domain: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EnrichmentDomainWhois or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EnrichmentDomainWhois] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- subscription_id=self._config.subscription_id,
- domain=domain,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EnrichmentDomainWhois", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_get_timeline_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_get_timeline_operations.py
deleted file mode 100644
index 0cdd1ffdd887..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_get_timeline_operations.py
+++ /dev/null
@@ -1,260 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_list_request(
- resource_group_name: str, workspace_name: str, entity_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class EntitiesGetTimelineOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`entities_get_timeline` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @overload
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: _models.EntityTimelineParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityTimelineResponse:
- """Timeline for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an timeline operation on the given
- entity. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityTimelineParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityTimelineResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityTimelineResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityTimelineResponse:
- """Timeline for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an timeline operation on the given
- entity. Required.
- :type parameters: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityTimelineResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityTimelineResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: Union[_models.EntityTimelineParameters, IO],
- **kwargs: Any
- ) -> _models.EntityTimelineResponse:
- """Timeline for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an timeline operation on the given
- entity. Is either a model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityTimelineParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityTimelineResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityTimelineResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityTimelineResponse] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "EntityTimelineParameters")
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EntityTimelineResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_operations.py
index 7a25ea360d46..16edf8d95e56 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,9 +5,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
-import urllib.parse
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -18,22 +17,19 @@
ResourceNotModifiedError,
map_error,
)
-from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,206 +37,23 @@
_SERIALIZER.client_side_validation = False
-def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
+def build_run_playbook_request(
+ resource_group_name: str, workspace_name: str, entity_identifier: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_get_request(
- resource_group_name: str, workspace_name: str, entity_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_expand_request(
- resource_group_name: str, workspace_name: str, entity_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_queries_request(
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- subscription_id: str,
- *,
- kind: Union[str, _models.EntityItemQueryKind],
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
- _params["kind"] = _SERIALIZER.query("kind", kind, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_get_insights_request(
- resource_group_name: str, workspace_name: str, entity_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityIdentifier}/runPlaybook",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -252,10 +65,10 @@ def build_get_insights_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
+ "entityIdentifier": _SERIALIZER.url("entity_identifier", entity_identifier, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -287,485 +100,95 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- @distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterable["_models.Entity"]:
- """Gets all entities.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either Entity or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Entity]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EntityList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- def extract_data(pipeline_response):
- deserialized = self._deserialize("EntityList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities"
- }
-
- @distributed_trace
- def get(self, resource_group_name: str, workspace_name: str, entity_id: str, **kwargs: Any) -> _models.Entity:
- """Gets an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Entity or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Entity
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Entity] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Entity", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}"
- }
-
- @overload
- def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: _models.EntityExpandParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityExpandResponse:
- """Expands an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an expand operation on the given entity.
- Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityExpandParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.EntityExpandResponse:
- """Expands an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an expand operation on the given entity.
- Required.
- :type parameters: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def expand(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- parameters: Union[_models.EntityExpandParameters, IO],
- **kwargs: Any
- ) -> _models.EntityExpandResponse:
- """Expands an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute an expand operation on the given entity.
- Is either a model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityExpandParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityExpandResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityExpandResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityExpandResponse] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "EntityExpandParameters")
-
- request = build_expand_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.expand.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EntityExpandResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- expand.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand"
- }
-
- @distributed_trace
- def queries(
- self,
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- kind: Union[str, _models.EntityItemQueryKind],
- **kwargs: Any
- ) -> _models.GetQueriesResponse:
- """Get Insights and Activities for an entity.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param kind: The Kind parameter for queries. "Insight" Required.
- :type kind: str or ~azure.mgmt.securityinsight.models.EntityItemQueryKind
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: GetQueriesResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.GetQueriesResponse
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.GetQueriesResponse] = kwargs.pop("cls", None)
-
- request = build_queries_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- subscription_id=self._config.subscription_id,
- kind=kind,
- api_version=api_version,
- template_url=self.queries.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("GetQueriesResponse", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- queries.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries"
- }
-
@overload
- def get_insights(
+ def run_playbook(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
- parameters: _models.EntityGetInsightsParameters,
+ entity_identifier: str,
+ request_body: Optional[_models.EntityManualTriggerRequestBody] = None,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityGetInsightsResponse:
- """Execute Insights for an entity.
+ ) -> None:
+ """Triggers playbook on a specific entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute insights on the given entity. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityGetInsightsParameters
+ :param entity_identifier: Entity ID. Required.
+ :type entity_identifier: str
+ :param request_body: Describes the request body for triggering a playbook on an entity. Default
+ value is None.
+ :type request_body: ~azure.mgmt.securityinsight.models.EntityManualTriggerRequestBody
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityGetInsightsResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityGetInsightsResponse
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- def get_insights(
+ def run_playbook(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
- parameters: IO,
+ entity_identifier: str,
+ request_body: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.EntityGetInsightsResponse:
- """Execute Insights for an entity.
+ ) -> None:
+ """Triggers playbook on a specific entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute insights on the given entity. Required.
- :type parameters: IO
+ :param entity_identifier: Entity ID. Required.
+ :type entity_identifier: str
+ :param request_body: Describes the request body for triggering a playbook on an entity. Default
+ value is None.
+ :type request_body: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityGetInsightsResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityGetInsightsResponse
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
- def get_insights(
+ def run_playbook( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
- parameters: Union[_models.EntityGetInsightsParameters, IO],
+ entity_identifier: str,
+ request_body: Optional[Union[_models.EntityManualTriggerRequestBody, IO[bytes]]] = None,
**kwargs: Any
- ) -> _models.EntityGetInsightsResponse:
- """Execute Insights for an entity.
+ ) -> None:
+ """Triggers playbook on a specific entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param parameters: The parameters required to execute insights on the given entity. Is either a
- model type or a IO type. Required.
- :type parameters: ~azure.mgmt.securityinsight.models.EntityGetInsightsParameters or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EntityGetInsightsResponse or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EntityGetInsightsResponse
+ :param entity_identifier: Entity ID. Required.
+ :type entity_identifier: str
+ :param request_body: Describes the request body for triggering a playbook on an entity. Is
+ either a EntityManualTriggerRequestBody type or a IO[bytes] type. Default value is None.
+ :type request_body: ~azure.mgmt.securityinsight.models.EntityManualTriggerRequestBody or
+ IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -776,53 +199,45 @@ def get_insights(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityGetInsightsResponse] = kwargs.pop("cls", None)
+ cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(parameters, (IO, bytes)):
- _content = parameters
+ if isinstance(request_body, (IOBase, bytes)):
+ _content = request_body
else:
- _json = self._serialize.body(parameters, "EntityGetInsightsParameters")
+ if request_body is not None:
+ _json = self._serialize.body(request_body, "EntityManualTriggerRequestBody")
+ else:
+ _json = None
- request = build_get_insights_request(
+ _request = build_run_playbook_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_id=entity_id,
+ entity_identifier=entity_identifier,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
- template_url=self.get_insights.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200]:
+ if response.status_code not in [204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("EntityGetInsightsResponse", pipeline_response)
-
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get_insights.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_relations_operations.py
deleted file mode 100644
index 676e478cc9d2..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entity_relations_operations.py
+++ /dev/null
@@ -1,179 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, Optional, TypeVar
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_get_relation_request(
- resource_group_name: str,
- workspace_name: str,
- entity_id: str,
- relation_name: str,
- subscription_id: str,
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations/{relationName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class EntityRelationsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`entity_relations` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def get_relation(
- self, resource_group_name: str, workspace_name: str, entity_id: str, relation_name: str, **kwargs: Any
- ) -> _models.Relation:
- """Gets an entity relation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
- :param relation_name: Relation Name. Required.
- :type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Relation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Relation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
-
- request = build_get_relation_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- entity_id=entity_id,
- relation_name=relation_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get_relation.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get_relation.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations/{relationName}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_file_imports_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_file_imports_operations.py
deleted file mode 100644
index 156bf96f7654..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_file_imports_operations.py
+++ /dev/null
@@ -1,718 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
-import urllib.parse
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.paging import ItemPaged
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-from azure.mgmt.core.polling.arm_polling import ARMPolling
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_list_request(
- resource_group_name: str,
- workspace_name: str,
- subscription_id: str,
- *,
- filter: Optional[str] = None,
- orderby: Optional[str] = None,
- top: Optional[int] = None,
- skip_token: Optional[str] = None,
- **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
- if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
- if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
- if top is not None:
- _params["$top"] = _SERIALIZER.query("top", top, "int")
- if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_get_request(
- resource_group_name: str, workspace_name: str, file_import_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "fileImportId": _SERIALIZER.url("file_import_id", file_import_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_create_request(
- resource_group_name: str, workspace_name: str, file_import_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "fileImportId": _SERIALIZER.url("file_import_id", file_import_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_delete_request(
- resource_group_name: str, workspace_name: str, file_import_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "fileImportId": _SERIALIZER.url("file_import_id", file_import_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class FileImportsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`file_imports` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def list(
- self,
- resource_group_name: str,
- workspace_name: str,
- filter: Optional[str] = None,
- orderby: Optional[str] = None,
- top: Optional[int] = None,
- skip_token: Optional[str] = None,
- **kwargs: Any
- ) -> Iterable["_models.FileImport"]:
- """Gets all file imports.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
- None.
- :type filter: str
- :param orderby: Sorts the results. Optional. Default value is None.
- :type orderby: str
- :param top: Returns only the first n results. Optional. Default value is None.
- :type top: int
- :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
- a previous response contains a nextLink element, the value of the nextLink element will include
- a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
- Default value is None.
- :type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either FileImport or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.FileImport]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.FileImportList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- def prepare_request(next_link=None):
- if not next_link:
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- filter=filter,
- orderby=orderby,
- top=top,
- skip_token=skip_token,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- else:
- # make call to next link with the client's api-version
- _parsed_next_link = urllib.parse.urlparse(next_link)
- _next_request_params = case_insensitive_dict(
- {
- key: [urllib.parse.quote(v) for v in value]
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
- }
- )
- _next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
-
- def extract_data(pipeline_response):
- deserialized = self._deserialize("FileImportList", pipeline_response)
- list_of_elem = deserialized.value
- if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
- return deserialized.next_link or None, iter(list_of_elem)
-
- def get_next(next_link=None):
- request = prepare_request(next_link)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- return pipeline_response
-
- return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports"
- }
-
- @distributed_trace
- def get(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
- ) -> _models.FileImport:
- """Gets a file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("FileImport", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
-
- @overload
- def create(
- self,
- resource_group_name: str,
- workspace_name: str,
- file_import_id: str,
- file_import: _models.FileImport,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.FileImport:
- """Creates the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :param file_import: The file import. Required.
- :type file_import: ~azure.mgmt.securityinsight.models.FileImport
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def create(
- self,
- resource_group_name: str,
- workspace_name: str,
- file_import_id: str,
- file_import: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.FileImport:
- """Creates the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :param file_import: The file import. Required.
- :type file_import: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def create(
- self,
- resource_group_name: str,
- workspace_name: str,
- file_import_id: str,
- file_import: Union[_models.FileImport, IO],
- **kwargs: Any
- ) -> _models.FileImport:
- """Creates the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :param file_import: The file import. Is either a model type or a IO type. Required.
- :type file_import: ~azure.mgmt.securityinsight.models.FileImport or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: FileImport or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.FileImport
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(file_import, (IO, bytes)):
- _content = file_import
- else:
- _json = self._serialize.body(file_import, "FileImport")
-
- request = build_create_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("FileImport", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
-
- def _delete_initial(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
- ) -> Optional[_models.FileImport]:
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[Optional[_models.FileImport]] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self._delete_initial.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [202, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = None
- if response.status_code == 202:
- deserialized = self._deserialize("FileImport", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- _delete_initial.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
-
- @distributed_trace
- def begin_delete(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
- ) -> LROPoller[_models.FileImport]:
- """Delete the file import.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param file_import_id: File import ID. Required.
- :type file_import_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
- operation to not poll, or pass in your own initialized polling object for a personal polling
- strategy.
- :paramtype polling: bool or ~azure.core.polling.PollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of LROPoller that returns either FileImport or the result of cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.FileImport]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
- polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
- if cont_token is None:
- raw_result = self._delete_initial(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- file_import_id=file_import_id,
- api_version=api_version,
- cls=lambda x, y, z: x,
- headers=_headers,
- params=_params,
- **kwargs
- )
- kwargs.pop("error_map", None)
-
- def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("FileImport", pipeline_response)
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
-
- if polling is True:
- polling_method: PollingMethod = cast(
- PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
- )
- elif polling is False:
- polling_method = cast(PollingMethod, NoPolling())
- else:
- polling_method = polling
- if cont_token:
- return LROPoller.from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
-
- begin_delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_comments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_comments_operations.py
index 8b63ffbf0831..e33b930b8251 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_comments_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_comments_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -56,9 +54,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -67,7 +63,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -82,7 +78,7 @@ def build_list_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -112,9 +108,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -123,7 +117,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -139,7 +133,7 @@ def build_get_request(
"incidentCommentId": _SERIALIZER.url("incident_comment_id", incident_comment_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -161,9 +155,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -173,7 +165,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -189,7 +181,7 @@ def build_create_or_update_request(
"incidentCommentId": _SERIALIZER.url("incident_comment_id", incident_comment_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -213,9 +205,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -224,7 +214,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -240,7 +230,7 @@ def build_delete_request(
"incidentCommentId": _SERIALIZER.url("incident_comment_id", incident_comment_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -282,7 +272,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> Iterable["_models.IncidentComment"]:
- """Gets all incident comments.
+ """Gets all comments for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -303,7 +293,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IncidentComment or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.IncidentComment]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -311,12 +300,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentCommentList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -327,7 +314,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -337,12 +324,10 @@ def prepare_request(next_link=None):
top=top,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -354,13 +339,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("IncidentCommentList", pipeline_response)
@@ -370,10 +354,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -385,15 +370,11 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
) -> _models.IncidentComment:
- """Gets an incident comment.
+ """Gets a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -404,12 +385,11 @@ def get(
:type incident_id: str
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -420,27 +400,24 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentComment] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_comment_id=incident_comment_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -449,16 +426,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentComment", pipeline_response)
+ deserialized = self._deserialize("IncidentComment", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -472,7 +445,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.IncidentComment:
- """Creates or updates the incident comment.
+ """Creates or updates a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -488,7 +461,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
@@ -501,12 +473,12 @@ def create_or_update(
workspace_name: str,
incident_id: str,
incident_comment_id: str,
- incident_comment: IO,
+ incident_comment: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.IncidentComment:
- """Creates or updates the incident comment.
+ """Creates or updates a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -518,11 +490,10 @@ def create_or_update(
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
:param incident_comment: The incident comment. Required.
- :type incident_comment: IO
+ :type incident_comment: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
@@ -535,10 +506,10 @@ def create_or_update(
workspace_name: str,
incident_id: str,
incident_comment_id: str,
- incident_comment: Union[_models.IncidentComment, IO],
+ incident_comment: Union[_models.IncidentComment, IO[bytes]],
**kwargs: Any
) -> _models.IncidentComment:
- """Creates or updates the incident comment.
+ """Creates or updates a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -549,17 +520,14 @@ def create_or_update(
:type incident_id: str
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
- :param incident_comment: The incident comment. Is either a model type or a IO type. Required.
- :type incident_comment: ~azure.mgmt.securityinsight.models.IncidentComment or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param incident_comment: The incident comment. Is either a IncidentComment type or a IO[bytes]
+ type. Required.
+ :type incident_comment: ~azure.mgmt.securityinsight.models.IncidentComment or IO[bytes]
:return: IncidentComment or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentComment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -570,21 +538,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.IncidentComment] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(incident_comment, (IO, bytes)):
+ if isinstance(incident_comment, (IOBase, bytes)):
_content = incident_comment
else:
_json = self._serialize.body(incident_comment, "IncidentComment")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -594,15 +560,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -611,26 +576,18 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("IncidentComment", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("IncidentComment", pipeline_response)
+ deserialized = self._deserialize("IncidentComment", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
) -> None:
- """Delete the incident comment.
+ """Deletes a comment for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -641,12 +598,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type incident_id: str
:param incident_comment_id: Incident comment ID. Required.
:type incident_comment_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -657,27 +613,24 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_comment_id=incident_comment_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -687,8 +640,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_relations_operations.py
index 4c9164691097..a7c393a94432 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_relations_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_relations_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -56,9 +54,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -67,7 +63,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -82,7 +78,7 @@ def build_list_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -112,9 +108,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -123,7 +117,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -136,10 +130,12 @@ def build_get_request(
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
+ "relationName": _SERIALIZER.url(
+ "relation_name", relation_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9-]{3,63}$"
+ ),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -161,9 +157,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -173,7 +167,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -186,10 +180,12 @@ def build_create_or_update_request(
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
+ "relationName": _SERIALIZER.url(
+ "relation_name", relation_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9-]{3,63}$"
+ ),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -213,9 +209,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -224,7 +218,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -237,10 +231,12 @@ def build_delete_request(
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
+ "relationName": _SERIALIZER.url(
+ "relation_name", relation_name, "str", max_length=63, min_length=3, pattern=r"^[a-zA-Z0-9-]{3,63}$"
+ ),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -282,7 +278,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> Iterable["_models.Relation"]:
- """Gets all incident relations.
+ """Gets all relations for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -303,7 +299,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Relation or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Relation]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -311,12 +306,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -327,7 +320,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -337,12 +330,10 @@ def prepare_request(next_link=None):
top=top,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -354,13 +345,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("RelationList", pipeline_response)
@@ -370,10 +360,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -385,15 +376,11 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
) -> _models.Relation:
- """Gets an incident relation.
+ """Gets a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -404,12 +391,11 @@ def get(
:type incident_id: str
:param relation_name: Relation Name. Required.
:type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -420,27 +406,24 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
relation_name=relation_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -449,16 +432,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Relation", pipeline_response)
+ deserialized = self._deserialize("Relation", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -472,7 +451,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.Relation:
- """Creates or updates the incident relation.
+ """Creates or updates a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -488,7 +467,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -501,12 +479,12 @@ def create_or_update(
workspace_name: str,
incident_id: str,
relation_name: str,
- relation: IO,
+ relation: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.Relation:
- """Creates or updates the incident relation.
+ """Creates or updates a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -518,11 +496,10 @@ def create_or_update(
:param relation_name: Relation Name. Required.
:type relation_name: str
:param relation: The relation model. Required.
- :type relation: IO
+ :type relation: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -535,10 +512,10 @@ def create_or_update(
workspace_name: str,
incident_id: str,
relation_name: str,
- relation: Union[_models.Relation, IO],
+ relation: Union[_models.Relation, IO[bytes]],
**kwargs: Any
) -> _models.Relation:
- """Creates or updates the incident relation.
+ """Creates or updates a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -549,17 +526,13 @@ def create_or_update(
:type incident_id: str
:param relation_name: Relation Name. Required.
:type relation_name: str
- :param relation: The relation model. Is either a model type or a IO type. Required.
- :type relation: ~azure.mgmt.securityinsight.models.Relation or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param relation: The relation model. Is either a Relation type or a IO[bytes] type. Required.
+ :type relation: ~azure.mgmt.securityinsight.models.Relation or IO[bytes]
:return: Relation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Relation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -570,21 +543,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(relation, (IO, bytes)):
+ if isinstance(relation, (IOBase, bytes)):
_content = relation
else:
_json = self._serialize.body(relation, "Relation")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -594,15 +565,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -611,26 +581,18 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("Relation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Relation", pipeline_response)
+ deserialized = self._deserialize("Relation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
) -> None:
- """Delete the incident relation.
+ """Deletes a relation for a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -641,12 +603,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type incident_id: str
:param relation_name: Relation Name. Required.
:type relation_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -657,27 +618,24 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
relation_name=relation_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -687,8 +645,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_tasks_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_tasks_operations.py
index 95ff858a910f..525c48679492 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_tasks_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incident_tasks_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -73,7 +69,7 @@ def build_list_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -95,9 +91,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -106,7 +100,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -122,7 +116,7 @@ def build_get_request(
"incidentTaskId": _SERIALIZER.url("incident_task_id", incident_task_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -144,9 +138,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -156,7 +148,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -172,7 +164,7 @@ def build_create_or_update_request(
"incidentTaskId": _SERIALIZER.url("incident_task_id", incident_task_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -196,9 +188,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -207,7 +197,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -223,7 +213,7 @@ def build_delete_request(
"incidentTaskId": _SERIALIZER.url("incident_task_id", incident_task_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -266,7 +256,6 @@ def list(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either IncidentTask or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.IncidentTask]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -274,12 +263,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentTaskList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -290,18 +277,16 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -313,13 +298,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("IncidentTaskList", pipeline_response)
@@ -329,10 +313,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -344,10 +329,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
@@ -363,12 +344,11 @@ def get(
:type incident_id: str
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -379,27 +359,24 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentTask] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_task_id=incident_task_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -408,16 +385,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentTask", pipeline_response)
+ deserialized = self._deserialize("IncidentTask", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -447,7 +420,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
@@ -460,7 +432,7 @@ def create_or_update(
workspace_name: str,
incident_id: str,
incident_task_id: str,
- incident_task: IO,
+ incident_task: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -477,11 +449,10 @@ def create_or_update(
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
:param incident_task: The incident task. Required.
- :type incident_task: IO
+ :type incident_task: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
@@ -494,7 +465,7 @@ def create_or_update(
workspace_name: str,
incident_id: str,
incident_task_id: str,
- incident_task: Union[_models.IncidentTask, IO],
+ incident_task: Union[_models.IncidentTask, IO[bytes]],
**kwargs: Any
) -> _models.IncidentTask:
"""Creates or updates the incident task.
@@ -508,17 +479,14 @@ def create_or_update(
:type incident_id: str
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
- :param incident_task: The incident task. Is either a model type or a IO type. Required.
- :type incident_task: ~azure.mgmt.securityinsight.models.IncidentTask or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param incident_task: The incident task. Is either a IncidentTask type or a IO[bytes] type.
+ Required.
+ :type incident_task: ~azure.mgmt.securityinsight.models.IncidentTask or IO[bytes]
:return: IncidentTask or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentTask
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -529,21 +497,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.IncidentTask] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(incident_task, (IO, bytes)):
+ if isinstance(incident_task, (IOBase, bytes)):
_content = incident_task
else:
_json = self._serialize.body(incident_task, "IncidentTask")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -553,15 +519,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -570,21 +535,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("IncidentTask", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("IncidentTask", pipeline_response)
+ deserialized = self._deserialize("IncidentTask", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
@@ -600,12 +557,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type incident_id: str
:param incident_task_id: Incident task ID. Required.
:type incident_task_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -616,27 +572,24 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
incident_task_id=incident_task_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -646,8 +599,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incidents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incidents_operations.py
index fcbe3e15a34c..4cfd9f823f7f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incidents_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_incidents_operations.py
@@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,25 +21,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,9 +46,7 @@ def build_run_playbook_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -64,7 +56,7 @@ def build_run_playbook_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -79,7 +71,7 @@ def build_run_playbook_request(
"incidentIdentifier": _SERIALIZER.url("incident_identifier", incident_identifier, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -106,9 +98,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -117,7 +107,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -131,7 +121,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -140,7 +130,7 @@ def build_list_request(
if orderby is not None:
_params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
if top is not None:
- _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000)
if skip_token is not None:
_params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
@@ -156,9 +146,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -167,7 +155,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -182,7 +170,7 @@ def build_get_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -199,9 +187,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -211,7 +197,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -226,7 +212,7 @@ def build_create_or_update_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -245,9 +231,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -256,7 +240,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -271,7 +255,7 @@ def build_delete_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -282,61 +266,13 @@ def build_delete_request(
return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-def build_create_team_request(
- resource_group_name: str, workspace_name: str, incident_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
-
-
def build_list_alerts_request(
resource_group_name: str, workspace_name: str, incident_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -345,7 +281,7 @@ def build_list_alerts_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -360,7 +296,7 @@ def build_list_alerts_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -377,9 +313,7 @@ def build_list_bookmarks_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -388,7 +322,7 @@ def build_list_bookmarks_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -403,7 +337,7 @@ def build_list_bookmarks_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -420,9 +354,7 @@ def build_list_entities_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -431,7 +363,7 @@ def build_list_entities_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -446,7 +378,7 @@ def build_list_entities_request(
"incidentId": _SERIALIZER.url("incident_id", incident_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -486,7 +418,7 @@ def run_playbook(
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> JSON:
+ ) -> None:
"""Triggers playbook on a specific incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -494,16 +426,16 @@ def run_playbook(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param incident_identifier: Required.
+ :param incident_identifier: Incident ID. Required.
:type incident_identifier: str
- :param request_body: Default value is None.
+ :param request_body: Describes the request body for triggering a playbook on an incident.
+ Default value is None.
:type request_body: ~azure.mgmt.securityinsight.models.ManualTriggerRequestBody
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: JSON or the result of cls(response)
- :rtype: JSON
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@@ -513,11 +445,11 @@ def run_playbook(
resource_group_name: str,
workspace_name: str,
incident_identifier: str,
- request_body: Optional[IO] = None,
+ request_body: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> JSON:
+ ) -> None:
"""Triggers playbook on a specific incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -525,28 +457,28 @@ def run_playbook(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param incident_identifier: Required.
+ :param incident_identifier: Incident ID. Required.
:type incident_identifier: str
- :param request_body: Default value is None.
- :type request_body: IO
+ :param request_body: Describes the request body for triggering a playbook on an incident.
+ Default value is None.
+ :type request_body: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: JSON or the result of cls(response)
- :rtype: JSON
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
- def run_playbook(
+ def run_playbook( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
workspace_name: str,
incident_identifier: str,
- request_body: Optional[Union[_models.ManualTriggerRequestBody, IO]] = None,
+ request_body: Optional[Union[_models.ManualTriggerRequestBody, IO[bytes]]] = None,
**kwargs: Any
- ) -> JSON:
+ ) -> None:
"""Triggers playbook on a specific incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -554,19 +486,16 @@ def run_playbook(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param incident_identifier: Required.
+ :param incident_identifier: Incident ID. Required.
:type incident_identifier: str
- :param request_body: Is either a model type or a IO type. Default value is None.
- :type request_body: ~azure.mgmt.securityinsight.models.ManualTriggerRequestBody or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: JSON or the result of cls(response)
- :rtype: JSON
+ :param request_body: Describes the request body for triggering a playbook on an incident. Is
+ either a ManualTriggerRequestBody type or a IO[bytes] type. Default value is None.
+ :type request_body: ~azure.mgmt.securityinsight.models.ManualTriggerRequestBody or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -577,16 +506,14 @@ def run_playbook(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[JSON] = kwargs.pop("cls", None)
+ cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(request_body, (IO, bytes)):
+ if isinstance(request_body, (IOBase, bytes)):
_content = request_body
else:
if request_body is not None:
@@ -594,7 +521,7 @@ def run_playbook(
else:
_json = None
- request = build_run_playbook_request(
+ _request = build_run_playbook_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_identifier=incident_identifier,
@@ -603,15 +530,14 @@ def run_playbook(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.run_playbook.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -620,16 +546,8 @@ def run_playbook(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("object", pipeline_response)
-
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- run_playbook.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def list(
@@ -661,7 +579,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Incident or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Incident]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -669,12 +586,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -685,7 +600,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -694,12 +609,10 @@ def prepare_request(next_link=None):
top=top,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -711,13 +624,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("IncidentList", pipeline_response)
@@ -727,10 +639,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -742,13 +655,9 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents"
- }
-
@distributed_trace
def get(self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any) -> _models.Incident:
- """Gets an incident.
+ """Gets a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -757,12 +666,11 @@ def get(self, resource_group_name: str, workspace_name: str, incident_id: str, *
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -773,26 +681,23 @@ def get(self, resource_group_name: str, workspace_name: str, incident_id: str, *
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Incident] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -801,16 +706,12 @@ def get(self, resource_group_name: str, workspace_name: str, incident_id: str, *
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Incident", pipeline_response)
+ deserialized = self._deserialize("Incident", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -823,7 +724,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.Incident:
- """Creates or updates the incident.
+ """Creates or updates an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -837,7 +738,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
@@ -849,12 +749,12 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
incident_id: str,
- incident: IO,
+ incident: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.Incident:
- """Creates or updates the incident.
+ """Creates or updates an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -864,11 +764,10 @@ def create_or_update(
:param incident_id: Incident ID. Required.
:type incident_id: str
:param incident: The incident. Required.
- :type incident: IO
+ :type incident: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
@@ -880,10 +779,10 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
incident_id: str,
- incident: Union[_models.Incident, IO],
+ incident: Union[_models.Incident, IO[bytes]],
**kwargs: Any
) -> _models.Incident:
- """Creates or updates the incident.
+ """Creates or updates an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -892,17 +791,13 @@ def create_or_update(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :param incident: The incident. Is either a model type or a IO type. Required.
- :type incident: ~azure.mgmt.securityinsight.models.Incident or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param incident: The incident. Is either a Incident type or a IO[bytes] type. Required.
+ :type incident: ~azure.mgmt.securityinsight.models.Incident or IO[bytes]
:return: Incident or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Incident
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -913,21 +808,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Incident] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(incident, (IO, bytes)):
+ if isinstance(incident, (IOBase, bytes)):
_content = incident
else:
_json = self._serialize.body(incident, "Incident")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -936,15 +829,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -953,26 +845,18 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("Incident", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("Incident", pipeline_response)
+ deserialized = self._deserialize("Incident", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> None:
- """Delete the incident.
+ """Deletes a given incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -981,12 +865,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -997,26 +880,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -1026,172 +906,13 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
-
- @overload
- def create_team(
- self,
- resource_group_name: str,
- workspace_name: str,
- incident_id: str,
- team_properties: _models.TeamInformation,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.TeamInformation:
- """Creates a Microsoft team to investigate the incident by sharing information and insights
- between participants.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param incident_id: Incident ID. Required.
- :type incident_id: str
- :param team_properties: Team properties. Required.
- :type team_properties: ~azure.mgmt.securityinsight.models.TeamInformation
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: TeamInformation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.TeamInformation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def create_team(
- self,
- resource_group_name: str,
- workspace_name: str,
- incident_id: str,
- team_properties: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.TeamInformation:
- """Creates a Microsoft team to investigate the incident by sharing information and insights
- between participants.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param incident_id: Incident ID. Required.
- :type incident_id: str
- :param team_properties: Team properties. Required.
- :type team_properties: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: TeamInformation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.TeamInformation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def create_team(
- self,
- resource_group_name: str,
- workspace_name: str,
- incident_id: str,
- team_properties: Union[_models.TeamInformation, IO],
- **kwargs: Any
- ) -> _models.TeamInformation:
- """Creates a Microsoft team to investigate the incident by sharing information and insights
- between participants.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param incident_id: Incident ID. Required.
- :type incident_id: str
- :param team_properties: Team properties. Is either a model type or a IO type. Required.
- :type team_properties: ~azure.mgmt.securityinsight.models.TeamInformation or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: TeamInformation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.TeamInformation
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.TeamInformation] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(team_properties, (IO, bytes)):
- _content = team_properties
- else:
- _json = self._serialize.body(team_properties, "TeamInformation")
-
- request = build_create_team_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- incident_id=incident_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create_team.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("TeamInformation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- create_team.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def list_alerts(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.IncidentAlertList:
- """Gets all incident alerts.
+ """Gets all alerts for an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -1200,12 +921,11 @@ def list_alerts(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentAlertList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentAlertList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1216,26 +936,23 @@ def list_alerts(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentAlertList] = kwargs.pop("cls", None)
- request = build_list_alerts_request(
+ _request = build_list_alerts_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_alerts.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -1244,22 +961,18 @@ def list_alerts(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentAlertList", pipeline_response)
+ deserialized = self._deserialize("IncidentAlertList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list_alerts.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts"
- }
+ return deserialized # type: ignore
@distributed_trace
def list_bookmarks(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.IncidentBookmarkList:
- """Gets all incident bookmarks.
+ """Gets all bookmarks for an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -1268,12 +981,11 @@ def list_bookmarks(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentBookmarkList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentBookmarkList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1284,26 +996,23 @@ def list_bookmarks(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentBookmarkList] = kwargs.pop("cls", None)
- request = build_list_bookmarks_request(
+ _request = build_list_bookmarks_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_bookmarks.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -1312,22 +1021,18 @@ def list_bookmarks(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentBookmarkList", pipeline_response)
+ deserialized = self._deserialize("IncidentBookmarkList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list_bookmarks.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks"
- }
+ return deserialized # type: ignore
@distributed_trace
def list_entities(
self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
) -> _models.IncidentEntitiesResponse:
- """Gets all incident related entities.
+ """Gets all entities for an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -1336,12 +1041,11 @@ def list_entities(
:type workspace_name: str
:param incident_id: Incident ID. Required.
:type incident_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: IncidentEntitiesResponse or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.IncidentEntitiesResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1352,26 +1056,23 @@ def list_entities(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.IncidentEntitiesResponse] = kwargs.pop("cls", None)
- request = build_list_entities_request(
+ _request = build_list_entities_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list_entities.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -1380,13 +1081,9 @@ def list_entities(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("IncidentEntitiesResponse", pipeline_response)
+ deserialized = self._deserialize("IncidentEntitiesResponse", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list_entities.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_ip_geodata_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_ip_geodata_operations.py
deleted file mode 100644
index 89c8e309e108..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_ip_geodata_operations.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, Optional, TypeVar
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_get_request(resource_group_name: str, subscription_id: str, *, ip_address: str, **kwargs: Any) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
- _params["ipAddress"] = _SERIALIZER.query("ip_address", ip_address, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class IPGeodataOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`ip_geodata` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def get(self, resource_group_name: str, ip_address: str, **kwargs: Any) -> _models.EnrichmentIpGeodata:
- """Get geodata for a single IP address.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param ip_address: IP address (v4 or v6) to be enriched. Required.
- :type ip_address: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: EnrichmentIpGeodata or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.EnrichmentIpGeodata] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- subscription_id=self._config.subscription_id,
- ip_address=ip_address,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("EnrichmentIpGeodata", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_metadata_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_metadata_operations.py
index 532bea1e8db1..8ca97c2bf7b3 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_metadata_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_metadata_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -55,9 +53,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -66,7 +62,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -80,7 +76,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -105,9 +101,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -116,7 +110,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -128,10 +122,10 @@ def build_get_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str", pattern=r"^\S+$"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -148,9 +142,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -159,7 +151,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -171,10 +163,10 @@ def build_delete_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str", pattern=r"^\S+$"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -191,9 +183,7 @@ def build_create_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -203,7 +193,7 @@ def build_create_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -215,10 +205,10 @@ def build_create_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str", pattern=r"^\S+$"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -237,9 +227,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -249,7 +237,7 @@ def build_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -261,10 +249,10 @@ def build_update_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str", pattern=r"^\S+$"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -324,7 +312,6 @@ def list(
:param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
next page of results if there are any left. Default value is None.
:type skip: int
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either MetadataModel or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.MetadataModel]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -332,12 +319,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MetadataList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -348,7 +333,7 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -357,12 +342,10 @@ def prepare_request(next_link=None):
top=top,
skip=skip,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -374,13 +357,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("MetadataList", pipeline_response)
@@ -390,10 +372,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -405,10 +388,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
@@ -422,12 +401,11 @@ def get(
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -438,26 +416,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MetadataModel] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -466,16 +441,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("MetadataModel", pipeline_response)
+ deserialized = self._deserialize("MetadataModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
+ return deserialized # type: ignore
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
@@ -490,12 +461,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -506,26 +476,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -535,11 +502,7 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
def create(
@@ -566,7 +529,6 @@ def create(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -578,7 +540,7 @@ def create(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata: IO,
+ metadata: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -593,11 +555,10 @@ def create(
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
:param metadata: Metadata resource. Required.
- :type metadata: IO
+ :type metadata: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -609,7 +570,7 @@ def create(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata: Union[_models.MetadataModel, IO],
+ metadata: Union[_models.MetadataModel, IO[bytes]],
**kwargs: Any
) -> _models.MetadataModel:
"""Create a Metadata.
@@ -621,17 +582,14 @@ def create(
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :param metadata: Metadata resource. Is either a model type or a IO type. Required.
- :type metadata: ~azure.mgmt.securityinsight.models.MetadataModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param metadata: Metadata resource. Is either a MetadataModel type or a IO[bytes] type.
+ Required.
+ :type metadata: ~azure.mgmt.securityinsight.models.MetadataModel or IO[bytes]
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -642,21 +600,19 @@ def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MetadataModel] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(metadata, (IO, bytes)):
+ if isinstance(metadata, (IOBase, bytes)):
_content = metadata
else:
_json = self._serialize.body(metadata, "MetadataModel")
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
@@ -665,15 +621,14 @@ def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -682,21 +637,13 @@ def create(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("MetadataModel", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("MetadataModel", pipeline_response)
+ deserialized = self._deserialize("MetadataModel", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
-
@overload
def update(
self,
@@ -722,7 +669,6 @@ def update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -734,7 +680,7 @@ def update(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata_patch: IO,
+ metadata_patch: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -749,11 +695,10 @@ def update(
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
:param metadata_patch: Partial metadata request. Required.
- :type metadata_patch: IO
+ :type metadata_patch: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
@@ -765,7 +710,7 @@ def update(
resource_group_name: str,
workspace_name: str,
metadata_name: str,
- metadata_patch: Union[_models.MetadataPatch, IO],
+ metadata_patch: Union[_models.MetadataPatch, IO[bytes]],
**kwargs: Any
) -> _models.MetadataModel:
"""Update an existing Metadata.
@@ -777,17 +722,14 @@ def update(
:type workspace_name: str
:param metadata_name: The Metadata name. Required.
:type metadata_name: str
- :param metadata_patch: Partial metadata request. Is either a model type or a IO type. Required.
- :type metadata_patch: ~azure.mgmt.securityinsight.models.MetadataPatch or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param metadata_patch: Partial metadata request. Is either a MetadataPatch type or a IO[bytes]
+ type. Required.
+ :type metadata_patch: ~azure.mgmt.securityinsight.models.MetadataPatch or IO[bytes]
:return: MetadataModel or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.MetadataModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -798,21 +740,19 @@ def update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MetadataModel] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(metadata_patch, (IO, bytes)):
+ if isinstance(metadata_patch, (IOBase, bytes)):
_content = metadata_patch
else:
_json = self._serialize.body(metadata_patch, "MetadataPatch")
- request = build_update_request(
+ _request = build_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
metadata_name=metadata_name,
@@ -821,15 +761,14 @@ def update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -838,13 +777,9 @@ def update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("MetadataModel", pipeline_response)
+ deserialized = self._deserialize("MetadataModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_operations.py
index e74ff2e56de3..89c913949ed5 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,20 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -45,9 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -85,7 +80,6 @@ def __init__(self, *args, **kwargs):
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
"""Lists all operations available Azure Security Insights Resource Provider.
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -93,12 +87,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -109,14 +101,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -128,13 +118,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("OperationsList", pipeline_response)
@@ -144,10 +133,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -158,5 +148,3 @@ def get_next(next_link=None):
return pipeline_response
return ItemPaged(get_next, extract_data)
-
- list.metadata = {"url": "/providers/Microsoft.SecurityInsights/operations"}
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_recommendations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_package_operations.py
similarity index 67%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_recommendations_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_package_operations.py
index a6e5f145a99f..ac47d39083d8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_recommendations_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_package_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -18,20 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,24 +36,22 @@
_SERIALIZER.client_side_validation = False
-def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
+def build_get_request(
+ resource_group_name: str, workspace_name: str, package_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductPackages/{packageId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -68,9 +63,10 @@ def build_list_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
+ "packageId": _SERIALIZER.url("package_id", package_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -81,14 +77,14 @@ def build_list_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class GetRecommendationsOperations:
+class ProductPackageOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`get_recommendations` attribute.
+ :attr:`product_package` attribute.
"""
models = _models
@@ -101,20 +97,23 @@ def __init__(self, *args, **kwargs):
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.RecommendationList:
- """Gets a list of all recommendations.
+ def get(
+ self, resource_group_name: str, workspace_name: str, package_id: str, **kwargs: Any
+ ) -> _models.ProductPackageModel:
+ """Gets a package by its identifier from the catalog.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: RecommendationList or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.RecommendationList
+ :param package_id: package Id. Required.
+ :type package_id: str
+ :return: ProductPackageModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ProductPackageModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -125,25 +124,23 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.RecommendationList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductPackageModel] = kwargs.pop("cls", None)
- request = build_list_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
+ package_id=package_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -152,13 +149,9 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("RecommendationList", pipeline_response)
+ deserialized = self._deserialize("ProductPackageModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_packages_operations.py
similarity index 75%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_relations_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_packages_operations.py
index e160a77e83f7..034f594ac8a5 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_entities_relations_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_packages_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,20 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -44,30 +41,28 @@
def build_list_request(
resource_group_name: str,
workspace_name: str,
- entity_id: str,
subscription_id: str,
*,
filter: Optional[str] = None,
orderby: Optional[str] = None,
top: Optional[int] = None,
skip_token: Optional[str] = None,
+ search: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductPackages",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -79,10 +74,9 @@ def build_list_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -94,6 +88,8 @@ def build_list_request(
_params["$top"] = _SERIALIZER.query("top", top, "int")
if skip_token is not None:
_params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ if search is not None:
+ _params["$search"] = _SERIALIZER.query("search", search, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -101,14 +97,14 @@ def build_list_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class EntitiesRelationsOperations:
+class ProductPackagesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`entities_relations` attribute.
+ :attr:`product_packages` attribute.
"""
models = _models
@@ -125,22 +121,25 @@ def list(
self,
resource_group_name: str,
workspace_name: str,
- entity_id: str,
filter: Optional[str] = None,
orderby: Optional[str] = None,
top: Optional[int] = None,
skip_token: Optional[str] = None,
+ search: Optional[str] = None,
**kwargs: Any
- ) -> Iterable["_models.Relation"]:
- """Gets all relations of an entity.
+ ) -> Iterable["_models.ProductPackageModel"]:
+ """Gets all packages from the catalog.
+ Expandable properties:
+
+
+ * properties/installed
+ * properties/packagedContent.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param entity_id: entity ID. Required.
- :type entity_id: str
:param filter: Filters the results, based on a Boolean condition. Optional. Default value is
None.
:type filter: str
@@ -153,20 +152,19 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: An iterator like instance of either Relation or the result of cls(response)
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Relation]
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :return: An iterator like instance of either ProductPackageModel or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.ProductPackageModel]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductPackageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -177,22 +175,20 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- entity_id=entity_id,
subscription_id=self._config.subscription_id,
filter=filter,
orderby=orderby,
top=top,
skip_token=skip_token,
+ search=search,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -204,26 +200,26 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
- deserialized = self._deserialize("RelationList", pipeline_response)
+ deserialized = self._deserialize("ProductPackageList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -234,7 +230,3 @@ def get_next(next_link=None):
return pipeline_response
return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_settings_operations.py
deleted file mode 100644
index 86def718fd40..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_settings_operations.py
+++ /dev/null
@@ -1,583 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_get_request(
- resource_group_name: str, workspace_name: str, settings_name: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "settingsName": _SERIALIZER.url("settings_name", settings_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_delete_request(
- resource_group_name: str, workspace_name: str, settings_name: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "settingsName": _SERIALIZER.url("settings_name", settings_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_update_request(
- resource_group_name: str, workspace_name: str, settings_name: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "settingsName": _SERIALIZER.url("settings_name", settings_name, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class ProductSettingsOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`product_settings` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- @distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.SettingList:
- """List of all the settings.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SettingList or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SettingList
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.SettingList] = kwargs.pop("cls", None)
-
- request = build_list_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.list.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("SettingList", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings"
- }
-
- @distributed_trace
- def get(self, resource_group_name: str, workspace_name: str, settings_name: str, **kwargs: Any) -> _models.Settings:
- """Gets a setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Settings] = kwargs.pop("cls", None)
-
- request = build_get_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- settings_name=settings_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.get.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Settings", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
-
- @distributed_trace
- def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, settings_name: str, **kwargs: Any
- ) -> None:
- """Delete setting of the product.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
-
- request = build_delete_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- settings_name=settings_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- template_url=self.delete.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 204]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
-
- @overload
- def update(
- self,
- resource_group_name: str,
- workspace_name: str,
- settings_name: str,
- settings: _models.Settings,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Settings:
- """Updates setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :param settings: The setting. Required.
- :type settings: ~azure.mgmt.securityinsight.models.Settings
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def update(
- self,
- resource_group_name: str,
- workspace_name: str,
- settings_name: str,
- settings: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.Settings:
- """Updates setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :param settings: The setting. Required.
- :type settings: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def update(
- self,
- resource_group_name: str,
- workspace_name: str,
- settings_name: str,
- settings: Union[_models.Settings, IO],
- **kwargs: Any
- ) -> _models.Settings:
- """Updates setting.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param settings_name: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba.
- Required.
- :type settings_name: str
- :param settings: The setting. Is either a model type or a IO type. Required.
- :type settings: ~azure.mgmt.securityinsight.models.Settings or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Settings or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Settings
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Settings] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(settings, (IO, bytes)):
- _content = settings
- else:
- _json = self._serialize.body(settings, "Settings")
-
- request = build_update_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- settings_name=settings_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.update.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Settings", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_template_operations.py
similarity index 63%
rename from sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_template_operations.py
index 8d495ea329ef..6651044dfb57 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_template_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -18,20 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,24 +36,22 @@
_SERIALIZER.client_side_validation = False
-def build_single_recommendation_request(
- resource_group_name: str, workspace_name: str, recommendation_id: str, subscription_id: str, **kwargs: Any
+def build_get_request(
+ resource_group_name: str, workspace_name: str, template_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentproducttemplates/{templateId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -68,10 +63,10 @@ def build_single_recommendation_request(
min_length=1,
pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
),
- "recommendationId": _SERIALIZER.url("recommendation_id", recommendation_id, "str"),
+ "templateId": _SERIALIZER.url("template_id", template_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -82,14 +77,14 @@ def build_single_recommendation_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class GetOperations:
+class ProductTemplateOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`get` attribute.
+ :attr:`product_template` attribute.
"""
models = _models
@@ -102,24 +97,23 @@ def __init__(self, *args, **kwargs):
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
- def single_recommendation(
- self, resource_group_name: str, workspace_name: str, recommendation_id: str, **kwargs: Any
- ) -> _models.Recommendation:
- """Gets a recommendation by its id.
+ def get(
+ self, resource_group_name: str, workspace_name: str, template_id: str, **kwargs: Any
+ ) -> _models.ProductTemplateModel:
+ """Gets a template by its identifier.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Recommendation or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Recommendation
+ :param template_id: template Id. Required.
+ :type template_id: str
+ :return: ProductTemplateModel or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ProductTemplateModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -130,26 +124,23 @@ def single_recommendation(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductTemplateModel] = kwargs.pop("cls", None)
- request = build_single_recommendation_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
- recommendation_id=recommendation_id,
+ template_id=template_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.single_recommendation.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -158,13 +149,9 @@ def single_recommendation(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Recommendation", pipeline_response)
+ deserialized = self._deserialize("ProductTemplateModel", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- single_recommendation.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_templates_operations.py
new file mode 100644
index 000000000000..e56a7b8e3c4a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_templates_operations.py
@@ -0,0 +1,244 @@
+# 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 sys
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_list_request(
+ resource_group_name: str,
+ workspace_name: str,
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductTemplates",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "workspaceName": _SERIALIZER.url(
+ "workspace_name",
+ workspace_name,
+ "str",
+ max_length=90,
+ min_length=1,
+ pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if orderby is not None:
+ _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ if search is not None:
+ _params["$search"] = _SERIALIZER.query("search", search, "str")
+ if count is not None:
+ _params["$count"] = _SERIALIZER.query("count", count, "bool")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ if skip is not None:
+ _params["$skip"] = _SERIALIZER.query("skip", skip, "int")
+ if skip_token is not None:
+ _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class ProductTemplatesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`product_templates` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ search: Optional[str] = None,
+ count: Optional[bool] = None,
+ top: Optional[int] = None,
+ skip: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.ProductTemplateModel"]:
+ """Gets all templates in the catalog.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: str
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
+ :param search: Searches for a substring in the response. Optional. Default value is None.
+ :type search: str
+ :param count: Instructs the server to return only object count without actual body. Optional.
+ Default value is None.
+ :type count: bool
+ :param top: Returns only the first n results. Optional. Default value is None.
+ :type top: int
+ :param skip: Used to skip n elements in the OData query (offset). Returns a nextLink to the
+ next page of results if there are any left. Default value is None.
+ :type skip: int
+ :param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
+ a previous response contains a nextLink element, the value of the nextLink element will include
+ a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
+ Default value is None.
+ :type skip_token: str
+ :return: An iterator like instance of either ProductTemplateModel or the result of
+ cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.ProductTemplateModel]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ProductTemplateList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ search=search,
+ count=count,
+ top=top,
+ skip=skip,
+ skip_token=skip_token,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ProductTemplateList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_ml_analytics_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_ml_analytics_settings_operations.py
index 67f7732a0682..c6018256a023 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_ml_analytics_settings_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_ml_analytics_settings_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -72,7 +68,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,9 +85,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +94,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -115,7 +109,7 @@ def build_get_request(
"settingsResourceName": _SERIALIZER.url("settings_resource_name", settings_resource_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -132,9 +126,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -144,7 +136,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -159,7 +151,7 @@ def build_create_or_update_request(
"settingsResourceName": _SERIALIZER.url("settings_resource_name", settings_resource_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -178,9 +170,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -189,7 +179,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -204,7 +194,7 @@ def build_delete_request(
"settingsResourceName": _SERIALIZER.url("settings_resource_name", settings_resource_name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -245,7 +235,6 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SecurityMLAnalyticsSetting or the result of
cls(response)
:rtype:
@@ -255,12 +244,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SecurityMLAnalyticsSettingsList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -271,17 +258,15 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -293,13 +278,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("SecurityMLAnalyticsSettingsList", pipeline_response)
@@ -309,10 +293,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -324,10 +309,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
@@ -341,12 +322,11 @@ def get(
:type workspace_name: str
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -357,26 +337,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SecurityMLAnalyticsSetting] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_resource_name=settings_resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -385,16 +362,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response)
+ deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
+ return deserialized # type: ignore
@overload
def create_or_update(
@@ -422,7 +395,6 @@ def create_or_update(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
@@ -434,7 +406,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
settings_resource_name: str,
- security_ml_analytics_setting: IO,
+ security_ml_analytics_setting: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -449,11 +421,10 @@ def create_or_update(
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
:param security_ml_analytics_setting: The security ML Analytics setting. Required.
- :type security_ml_analytics_setting: IO
+ :type security_ml_analytics_setting: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
@@ -465,7 +436,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
settings_resource_name: str,
- security_ml_analytics_setting: Union[_models.SecurityMLAnalyticsSetting, IO],
+ security_ml_analytics_setting: Union[_models.SecurityMLAnalyticsSetting, IO[bytes]],
**kwargs: Any
) -> _models.SecurityMLAnalyticsSetting:
"""Creates or updates the Security ML Analytics Settings.
@@ -477,19 +448,15 @@ def create_or_update(
:type workspace_name: str
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
- :param security_ml_analytics_setting: The security ML Analytics setting. Is either a model type
- or a IO type. Required.
+ :param security_ml_analytics_setting: The security ML Analytics setting. Is either a
+ SecurityMLAnalyticsSetting type or a IO[bytes] type. Required.
:type security_ml_analytics_setting:
- ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting or IO[bytes]
:return: SecurityMLAnalyticsSetting or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -500,21 +467,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SecurityMLAnalyticsSetting] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(security_ml_analytics_setting, (IO, bytes)):
+ if isinstance(security_ml_analytics_setting, (IOBase, bytes)):
_content = security_ml_analytics_setting
else:
_json = self._serialize.body(security_ml_analytics_setting, "SecurityMLAnalyticsSetting")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_resource_name=settings_resource_name,
@@ -523,15 +488,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -540,21 +504,13 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response)
+ deserialized = self._deserialize("SecurityMLAnalyticsSetting", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
@@ -568,12 +524,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param settings_resource_name: Security ML Analytics Settings resource name. Required.
:type settings_resource_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -584,26 +539,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_resource_name=settings_resource_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -613,8 +565,4 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_sentinel_onboarding_states_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_sentinel_onboarding_states_operations.py
index dede32ea1345..5cb317293b7d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_sentinel_onboarding_states_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_sentinel_onboarding_states_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
@@ -18,20 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -49,9 +47,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +56,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -77,7 +73,7 @@ def build_get_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -98,9 +94,7 @@ def build_create_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -110,7 +104,7 @@ def build_create_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -127,7 +121,7 @@ def build_create_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -150,9 +144,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -161,7 +153,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -178,7 +170,7 @@ def build_delete_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -195,9 +187,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -206,7 +196,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -220,7 +210,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -264,12 +254,11 @@ def get(
:param sentinel_onboarding_state_name: The Sentinel onboarding state name. Supports - default.
Required.
:type sentinel_onboarding_state_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -280,26 +269,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SentinelOnboardingState] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
sentinel_onboarding_state_name=sentinel_onboarding_state_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -308,16 +294,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SentinelOnboardingState", pipeline_response)
+ deserialized = self._deserialize("SentinelOnboardingState", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
+ return deserialized # type: ignore
@overload
def create(
@@ -347,7 +329,6 @@ def create(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
@@ -359,7 +340,7 @@ def create(
resource_group_name: str,
workspace_name: str,
sentinel_onboarding_state_name: str,
- sentinel_onboarding_state_parameter: Optional[IO] = None,
+ sentinel_onboarding_state_parameter: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
@@ -376,11 +357,10 @@ def create(
:type sentinel_onboarding_state_name: str
:param sentinel_onboarding_state_parameter: The Sentinel onboarding state parameter. Default
value is None.
- :type sentinel_onboarding_state_parameter: IO
+ :type sentinel_onboarding_state_parameter: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
@@ -392,7 +372,7 @@ def create(
resource_group_name: str,
workspace_name: str,
sentinel_onboarding_state_name: str,
- sentinel_onboarding_state_parameter: Optional[Union[_models.SentinelOnboardingState, IO]] = None,
+ sentinel_onboarding_state_parameter: Optional[Union[_models.SentinelOnboardingState, IO[bytes]]] = None,
**kwargs: Any
) -> _models.SentinelOnboardingState:
"""Create Sentinel onboarding state.
@@ -406,18 +386,14 @@ def create(
Required.
:type sentinel_onboarding_state_name: str
:param sentinel_onboarding_state_parameter: The Sentinel onboarding state parameter. Is either
- a model type or a IO type. Default value is None.
+ a SentinelOnboardingState type or a IO[bytes] type. Default value is None.
:type sentinel_onboarding_state_parameter:
- ~azure.mgmt.securityinsight.models.SentinelOnboardingState or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.SentinelOnboardingState or IO[bytes]
:return: SentinelOnboardingState or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingState
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -428,16 +404,14 @@ def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SentinelOnboardingState] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(sentinel_onboarding_state_parameter, (IO, bytes)):
+ if isinstance(sentinel_onboarding_state_parameter, (IOBase, bytes)):
_content = sentinel_onboarding_state_parameter
else:
if sentinel_onboarding_state_parameter is not None:
@@ -445,7 +419,7 @@ def create(
else:
_json = None
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
sentinel_onboarding_state_name=sentinel_onboarding_state_name,
@@ -454,15 +428,14 @@ def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -471,21 +444,13 @@ def create(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("SentinelOnboardingState", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("SentinelOnboardingState", pipeline_response)
+ deserialized = self._deserialize("SentinelOnboardingState", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, sentinel_onboarding_state_name: str, **kwargs: Any
@@ -500,12 +465,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:param sentinel_onboarding_state_name: The Sentinel onboarding state name. Supports - default.
Required.
:type sentinel_onboarding_state_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -516,26 +480,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
sentinel_onboarding_state_name=sentinel_onboarding_state_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -545,11 +506,7 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def list(
@@ -562,12 +519,11 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SentinelOnboardingStatesList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SentinelOnboardingStatesList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -578,25 +534,22 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SentinelOnboardingStatesList] = kwargs.pop("cls", None)
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -605,13 +558,9 @@ def list(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SentinelOnboardingStatesList", pipeline_response)
+ deserialized = self._deserialize("SentinelOnboardingStatesList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_control_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_control_operations.py
index 4a4957b10d8d..ccbd35feed98 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_control_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_control_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,8 +5,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,19 +40,12 @@
def build_list_repositories_request(
- resource_group_name: str,
- workspace_name: str,
- subscription_id: str,
- *,
- json: Union[str, _models.RepoType],
- **kwargs: Any
+ resource_group_name: str, workspace_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -64,7 +55,7 @@ def build_list_repositories_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -78,7 +69,7 @@ def build_list_repositories_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -88,7 +79,7 @@ def build_list_repositories_request(
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, json=json, **kwargs)
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
class SourceControlOperations:
@@ -110,9 +101,67 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+ @overload
+ def list_repositories(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ repository_access: _models.RepositoryAccessProperties,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> Iterable["_models.Repo"]:
+ """Gets a list of repositories metadata.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An iterator like instance of either Repo or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Repo]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def list_repositories(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ repository_access: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> Iterable["_models.Repo"]:
+ """Gets a list of repositories metadata.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An iterator like instance of either Repo or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Repo]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
@distributed_trace
def list_repositories(
- self, resource_group_name: str, workspace_name: str, repo_type: Union[str, _models.RepoType], **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ repository_access: Union[_models.RepositoryAccessProperties, IO[bytes]],
+ **kwargs: Any
) -> Iterable["_models.Repo"]:
"""Gets a list of repositories metadata.
@@ -121,9 +170,10 @@ def list_repositories(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param repo_type: The repo type. Known values are: "Github" and "DevOps". Required.
- :type repo_type: str or ~azure.mgmt.securityinsight.models.RepoType
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param repository_access: The repository access credentials. Is either a
+ RepositoryAccessProperties type or a IO[bytes] type. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties or
+ IO[bytes]
:return: An iterator like instance of either Repo or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Repo]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -131,37 +181,40 @@ def list_repositories(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.RepoList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(repository_access, (IOBase, bytes)):
+ _content = repository_access
+ else:
+ _json = self._serialize.body(repository_access, "RepositoryAccessProperties")
def prepare_request(next_link=None):
if not next_link:
- _json = self._serialize.body(repo_type, "str")
- request = build_list_repositories_request(
+ _request = build_list_repositories_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
- template_url=self.list_repositories.metadata["url"],
+ content=_content,
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -173,13 +226,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("RepoList", pipeline_response)
@@ -189,10 +241,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -203,7 +256,3 @@ def get_next(next_link=None):
return pipeline_response
return ItemPaged(get_next, extract_data)
-
- list_repositories.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_controls_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_controls_operations.py
index e4f8c1291dc3..b4787b1d4f89 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_controls_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_source_controls_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +45,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -58,7 +54,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -72,7 +68,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -89,9 +85,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +94,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -115,7 +109,7 @@ def build_get_request(
"sourceControlId": _SERIALIZER.url("source_control_id", source_control_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -126,15 +120,14 @@ def build_get_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-def build_delete_request(
+def build_create_request(
resource_group_name: str, workspace_name: str, source_control_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -143,7 +136,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -158,36 +151,36 @@ def build_delete_request(
"sourceControlId": _SERIALIZER.url("source_control_id", source_control_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-def build_create_request(
+def build_delete_request(
resource_group_name: str, workspace_name: str, source_control_id: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}/delete",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -202,7 +195,7 @@ def build_create_request(
"sourceControlId": _SERIALIZER.url("source_control_id", source_control_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -212,7 +205,7 @@ def build_create_request(
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
class SourceControlsOperations:
@@ -243,7 +236,6 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SourceControl or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.SourceControl]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -251,12 +243,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SourceControlList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -267,17 +257,15 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) ->
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -289,13 +277,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("SourceControlList", pipeline_response)
@@ -305,10 +292,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -320,10 +308,6 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, source_control_id: str, **kwargs: Any
@@ -337,12 +321,11 @@ def get(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: SourceControl or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.SourceControl
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -353,26 +336,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
source_control_id=source_control_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -381,22 +361,83 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("SourceControl", pipeline_response)
+ deserialized = self._deserialize("SourceControl", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- return deserialized
+ return deserialized # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
+ @overload
+ def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ source_control: _models.SourceControl,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SourceControl:
+ """Creates a source control.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param source_control_id: Source control Id. Required.
+ :type source_control_id: str
+ :param source_control: The SourceControl. Required.
+ :type source_control: ~azure.mgmt.securityinsight.models.SourceControl
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SourceControl or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ source_control: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SourceControl:
+ """Creates a source control.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param source_control_id: Source control Id. Required.
+ :type source_control_id: str
+ :param source_control: The SourceControl. Required.
+ :type source_control: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SourceControl or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
@distributed_trace
- def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, source_control_id: str, **kwargs: Any
- ) -> None:
- """Delete a source control.
+ def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ source_control: Union[_models.SourceControl, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.SourceControl:
+ """Creates a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -405,12 +446,14 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
+ :param source_control: The SourceControl. Is either a SourceControl type or a IO[bytes] type.
+ Required.
+ :type source_control: ~azure.mgmt.securityinsight.models.SourceControl or IO[bytes]
+ :return: SourceControl or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SourceControl
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -418,56 +461,65 @@ def delete( # pylint: disable=inconsistent-return-statements
}
error_map.update(kwargs.pop("error_map", {}) or {})
- _headers = kwargs.pop("headers", {}) or {}
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None)
- request = build_delete_request(
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(source_control, (IOBase, bytes)):
+ _content = source_control
+ else:
+ _json = self._serialize.body(source_control, "SourceControl")
+
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
source_control_id=source_control_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
+ content_type=content_type,
+ json=_json,
+ content=_content,
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200, 204]:
+ if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = self._deserialize("SourceControl", pipeline_response.http_response)
+
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
+ return deserialized # type: ignore
@overload
- def create(
+ def delete(
self,
resource_group_name: str,
workspace_name: str,
source_control_id: str,
- source_control: _models.SourceControl,
+ repository_access: _models.RepositoryAccessProperties,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.SourceControl:
- """Creates a source control.
+ ) -> _models.Warning:
+ """Delete a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -476,29 +528,28 @@ def create(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :param source_control: The SourceControl. Required.
- :type source_control: ~azure.mgmt.securityinsight.models.SourceControl
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SourceControl or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :return: Warning or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Warning
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- def create(
+ def delete(
self,
resource_group_name: str,
workspace_name: str,
source_control_id: str,
- source_control: IO,
+ repository_access: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.SourceControl:
- """Creates a source control.
+ ) -> _models.Warning:
+ """Delete a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -507,27 +558,26 @@ def create(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :param source_control: The SourceControl. Required.
- :type source_control: IO
+ :param repository_access: The repository access credentials. Required.
+ :type repository_access: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SourceControl or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :return: Warning or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Warning
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
- def create(
+ def delete(
self,
resource_group_name: str,
workspace_name: str,
source_control_id: str,
- source_control: Union[_models.SourceControl, IO],
+ repository_access: Union[_models.RepositoryAccessProperties, IO[bytes]],
**kwargs: Any
- ) -> _models.SourceControl:
- """Creates a source control.
+ ) -> _models.Warning:
+ """Delete a source control.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -536,17 +586,15 @@ def create(
:type workspace_name: str
:param source_control_id: Source control Id. Required.
:type source_control_id: str
- :param source_control: The SourceControl. Is either a model type or a IO type. Required.
- :type source_control: ~azure.mgmt.securityinsight.models.SourceControl or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: SourceControl or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SourceControl
+ :param repository_access: The repository access credentials. Is either a
+ RepositoryAccessProperties type or a IO[bytes] type. Required.
+ :type repository_access: ~azure.mgmt.securityinsight.models.RepositoryAccessProperties or
+ IO[bytes]
+ :return: Warning or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Warning
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -557,21 +605,19 @@ def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None)
+ cls: ClsType[_models.Warning] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(source_control, (IO, bytes)):
- _content = source_control
+ if isinstance(repository_access, (IOBase, bytes)):
+ _content = repository_access
else:
- _json = self._serialize.body(source_control, "SourceControl")
+ _json = self._serialize.body(repository_access, "RepositoryAccessProperties")
- request = build_create_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
source_control_id=source_control_id,
@@ -580,34 +626,25 @@ def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200, 201]:
+ if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("SourceControl", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("SourceControl", pipeline_response)
+ deserialized = self._deserialize("Warning", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
-
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_metrics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_metrics_operations.py
index 282e791e6ca8..301d085d6cd4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_metrics_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_metrics_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -18,20 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -45,9 +42,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -56,7 +51,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -70,7 +65,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -81,7 +76,7 @@ def build_list_request(
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-class ThreatIntelligenceIndicatorMetricsOperations:
+class ThreatIntelligenceIndicatorMetricsOperations: # pylint: disable=name-too-long
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -111,12 +106,11 @@ def list(
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceMetricsList or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetricsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -127,25 +121,22 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ThreatIntelligenceMetricsList] = kwargs.pop("cls", None)
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -154,13 +145,9 @@ def list(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ThreatIntelligenceMetricsList", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceMetricsList", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_operations.py
index 6800898f0f65..a34e9e195b7a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_operations.py
@@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +21,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,9 +46,7 @@ def build_create_indicator_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -59,7 +56,7 @@ def build_create_indicator_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -73,7 +70,7 @@ def build_create_indicator_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -92,9 +89,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -103,7 +98,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -118,7 +113,7 @@ def build_get_request(
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -135,9 +130,7 @@ def build_create_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -147,7 +140,7 @@ def build_create_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -162,7 +155,7 @@ def build_create_request(
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -181,9 +174,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -192,7 +183,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -207,7 +198,7 @@ def build_delete_request(
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -224,9 +215,7 @@ def build_query_indicators_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -236,7 +225,7 @@ def build_query_indicators_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -250,7 +239,7 @@ def build_query_indicators_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -269,9 +258,7 @@ def build_append_tags_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -281,7 +268,7 @@ def build_append_tags_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -296,7 +283,7 @@ def build_append_tags_request(
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -315,9 +302,7 @@ def build_replace_tags_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -327,7 +312,7 @@ def build_replace_tags_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -342,7 +327,7 @@ def build_replace_tags_request(
"name": _SERIALIZER.url("name", name, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -398,7 +383,6 @@ def create_indicator(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -409,7 +393,7 @@ def create_indicator(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_properties: IO,
+ threat_intelligence_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -423,11 +407,10 @@ def create_indicator(
:type workspace_name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
and update. Required.
- :type threat_intelligence_properties: IO
+ :type threat_intelligence_properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -438,7 +421,7 @@ def create_indicator(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO],
+ threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO[bytes]],
**kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""Create a new threat intelligence indicator.
@@ -449,18 +432,14 @@ def create_indicator(
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
- and update. Is either a model type or a IO type. Required.
+ and update. Is either a ThreatIntelligenceIndicatorModel type or a IO[bytes] type. Required.
:type threat_intelligence_properties:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO[bytes]
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -471,21 +450,19 @@ def create_indicator(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_properties, (IO, bytes)):
+ if isinstance(threat_intelligence_properties, (IOBase, bytes)):
_content = threat_intelligence_properties
else:
_json = self._serialize.body(threat_intelligence_properties, "ThreatIntelligenceIndicatorModel")
- request = build_create_indicator_request(
+ _request = build_create_indicator_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -493,15 +470,14 @@ def create_indicator(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_indicator.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -510,21 +486,13 @@ def create_indicator(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create_indicator.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any
@@ -538,12 +506,11 @@ def get(
:type workspace_name: str
:param name: Threat intelligence indicator name field. Required.
:type name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -554,26 +521,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -582,16 +546,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
+ return deserialized # type: ignore
@overload
def create(
@@ -620,7 +580,6 @@ def create(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -632,7 +591,7 @@ def create(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_properties: IO,
+ threat_intelligence_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -648,11 +607,10 @@ def create(
:type name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
and update. Required.
- :type threat_intelligence_properties: IO
+ :type threat_intelligence_properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -664,7 +622,7 @@ def create(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO],
+ threat_intelligence_properties: Union[_models.ThreatIntelligenceIndicatorModel, IO[bytes]],
**kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""Update a threat Intelligence indicator.
@@ -677,18 +635,14 @@ def create(
:param name: Threat intelligence indicator name field. Required.
:type name: str
:param threat_intelligence_properties: Properties of threat intelligence indicators to create
- and update. Is either a model type or a IO type. Required.
+ and update. Is either a ThreatIntelligenceIndicatorModel type or a IO[bytes] type. Required.
:type threat_intelligence_properties:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO[bytes]
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -699,21 +653,19 @@ def create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_properties, (IO, bytes)):
+ if isinstance(threat_intelligence_properties, (IOBase, bytes)):
_content = threat_intelligence_properties
else:
_json = self._serialize.body(threat_intelligence_properties, "ThreatIntelligenceIndicatorModel")
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
@@ -722,15 +674,14 @@ def create(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -739,21 +690,13 @@ def create(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- create.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
-
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any
@@ -767,12 +710,11 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param name: Threat intelligence indicator name field. Required.
:type name: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -783,26 +725,23 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -812,11 +751,7 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
def query_indicators(
@@ -842,7 +777,6 @@ def query_indicators(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -855,7 +789,7 @@ def query_indicators(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_filtering_criteria: IO,
+ threat_intelligence_filtering_criteria: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -869,11 +803,10 @@ def query_indicators(
:type workspace_name: str
:param threat_intelligence_filtering_criteria: Filtering criteria for querying threat
intelligence indicators. Required.
- :type threat_intelligence_filtering_criteria: IO
+ :type threat_intelligence_filtering_criteria: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -886,7 +819,7 @@ def query_indicators(
self,
resource_group_name: str,
workspace_name: str,
- threat_intelligence_filtering_criteria: Union[_models.ThreatIntelligenceFilteringCriteria, IO],
+ threat_intelligence_filtering_criteria: Union[_models.ThreatIntelligenceFilteringCriteria, IO[bytes]],
**kwargs: Any
) -> Iterable["_models.ThreatIntelligenceInformation"]:
"""Query threat intelligence indicators as per filtering criteria.
@@ -897,13 +830,10 @@ def query_indicators(
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param threat_intelligence_filtering_criteria: Filtering criteria for querying threat
- intelligence indicators. Is either a model type or a IO type. Required.
+ intelligence indicators. Is either a ThreatIntelligenceFilteringCriteria type or a IO[bytes]
+ type. Required.
:type threat_intelligence_filtering_criteria:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceFilteringCriteria or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceFilteringCriteria or IO[bytes]
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -913,13 +843,11 @@ def query_indicators(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -929,7 +857,7 @@ def query_indicators(
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_filtering_criteria, (IO, bytes)):
+ if isinstance(threat_intelligence_filtering_criteria, (IOBase, bytes)):
_content = threat_intelligence_filtering_criteria
else:
_json = self._serialize.body(threat_intelligence_filtering_criteria, "ThreatIntelligenceFilteringCriteria")
@@ -937,7 +865,7 @@ def query_indicators(
def prepare_request(next_link=None):
if not next_link:
- request = build_query_indicators_request(
+ _request = build_query_indicators_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -945,12 +873,10 @@ def prepare_request(next_link=None):
content_type=content_type,
json=_json,
content=_content,
- template_url=self.query_indicators.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -962,13 +888,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ThreatIntelligenceInformationList", pipeline_response)
@@ -978,10 +903,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -993,12 +919,8 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- query_indicators.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators"
- }
-
@overload
- def append_tags( # pylint: disable=inconsistent-return-statements
+ def append_tags(
self,
resource_group_name: str,
workspace_name: str,
@@ -1024,19 +946,18 @@ def append_tags( # pylint: disable=inconsistent-return-statements
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- def append_tags( # pylint: disable=inconsistent-return-statements
+ def append_tags(
self,
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_append_tags: IO,
+ threat_intelligence_append_tags: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -1052,11 +973,10 @@ def append_tags( # pylint: disable=inconsistent-return-statements
:type name: str
:param threat_intelligence_append_tags: The threat intelligence append tags request body.
Required.
- :type threat_intelligence_append_tags: IO
+ :type threat_intelligence_append_tags: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1068,7 +988,7 @@ def append_tags( # pylint: disable=inconsistent-return-statements
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_append_tags: Union[_models.ThreatIntelligenceAppendTags, IO],
+ threat_intelligence_append_tags: Union[_models.ThreatIntelligenceAppendTags, IO[bytes]],
**kwargs: Any
) -> None:
"""Append tags to a threat intelligence indicator.
@@ -1081,18 +1001,14 @@ def append_tags( # pylint: disable=inconsistent-return-statements
:param name: Threat intelligence indicator name field. Required.
:type name: str
:param threat_intelligence_append_tags: The threat intelligence append tags request body. Is
- either a model type or a IO type. Required.
+ either a ThreatIntelligenceAppendTags type or a IO[bytes] type. Required.
:type threat_intelligence_append_tags:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceAppendTags or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceAppendTags or IO[bytes]
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1103,21 +1019,19 @@ def append_tags( # pylint: disable=inconsistent-return-statements
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_append_tags, (IO, bytes)):
+ if isinstance(threat_intelligence_append_tags, (IOBase, bytes)):
_content = threat_intelligence_append_tags
else:
_json = self._serialize.body(threat_intelligence_append_tags, "ThreatIntelligenceAppendTags")
- request = build_append_tags_request(
+ _request = build_append_tags_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
@@ -1126,15 +1040,14 @@ def append_tags( # pylint: disable=inconsistent-return-statements
content_type=content_type,
json=_json,
content=_content,
- template_url=self.append_tags.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -1144,11 +1057,7 @@ def append_tags( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- append_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
def replace_tags(
@@ -1177,7 +1086,6 @@ def replace_tags(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1189,7 +1097,7 @@ def replace_tags(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_replace_tags: IO,
+ threat_intelligence_replace_tags: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -1205,11 +1113,10 @@ def replace_tags(
:type name: str
:param threat_intelligence_replace_tags: Tags in the threat intelligence indicator to be
replaced. Required.
- :type threat_intelligence_replace_tags: IO
+ :type threat_intelligence_replace_tags: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1221,7 +1128,7 @@ def replace_tags(
resource_group_name: str,
workspace_name: str,
name: str,
- threat_intelligence_replace_tags: Union[_models.ThreatIntelligenceIndicatorModel, IO],
+ threat_intelligence_replace_tags: Union[_models.ThreatIntelligenceIndicatorModel, IO[bytes]],
**kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""Replace tags added to a threat intelligence indicator.
@@ -1234,18 +1141,14 @@ def replace_tags(
:param name: Threat intelligence indicator name field. Required.
:type name: str
:param threat_intelligence_replace_tags: Tags in the threat intelligence indicator to be
- replaced. Is either a model type or a IO type. Required.
+ replaced. Is either a ThreatIntelligenceIndicatorModel type or a IO[bytes] type. Required.
:type threat_intelligence_replace_tags:
- ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ ~azure.mgmt.securityinsight.models.ThreatIntelligenceIndicatorModel or IO[bytes]
:return: ThreatIntelligenceInformation or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1256,21 +1159,19 @@ def replace_tags(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(threat_intelligence_replace_tags, (IO, bytes)):
+ if isinstance(threat_intelligence_replace_tags, (IOBase, bytes)):
_content = threat_intelligence_replace_tags
else:
_json = self._serialize.body(threat_intelligence_replace_tags, "ThreatIntelligenceIndicatorModel")
- request = build_replace_tags_request(
+ _request = build_replace_tags_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
name=name,
@@ -1279,15 +1180,14 @@ def replace_tags(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.replace_tags.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -1296,13 +1196,9 @@ def replace_tags(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response)
+ deserialized = self._deserialize("ThreatIntelligenceInformation", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- replace_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags"
- }
+ return deserialized # type: ignore
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicators_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicators_operations.py
index 8353884e05ce..82c81cf11f59 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicators_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicators_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -20,20 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,17 +44,15 @@ def build_list_request(
subscription_id: str,
*,
filter: Optional[str] = None,
- orderby: Optional[str] = None,
top: Optional[int] = None,
skip_token: Optional[str] = None,
+ orderby: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -66,7 +61,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -80,18 +75,18 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str")
- if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int")
if skip_token is not None:
_params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ if orderby is not None:
+ _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -124,9 +119,9 @@ def list(
resource_group_name: str,
workspace_name: str,
filter: Optional[str] = None,
- orderby: Optional[str] = None,
top: Optional[int] = None,
skip_token: Optional[str] = None,
+ orderby: Optional[str] = None,
**kwargs: Any
) -> Iterable["_models.ThreatIntelligenceInformation"]:
"""Get all threat intelligence indicators.
@@ -139,8 +134,6 @@ def list(
:param filter: Filters the results, based on a Boolean condition. Optional. Default value is
None.
:type filter: str
- :param orderby: Sorts the results. Optional. Default value is None.
- :type orderby: str
:param top: Returns only the first n results. Optional. Default value is None.
:type top: int
:param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
@@ -148,7 +141,8 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param orderby: Sorts the results. Optional. Default value is None.
+ :type orderby: str
:return: An iterator like instance of either ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -158,12 +152,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -174,21 +166,19 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
filter=filter,
- orderby=orderby,
top=top,
skip_token=skip_token,
+ orderby=orderby,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -200,13 +190,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ThreatIntelligenceInformationList", pipeline_response)
@@ -216,10 +205,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -230,7 +220,3 @@ def get_next(next_link=None):
return pipeline_response
return ItemPaged(get_next, extract_data)
-
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_update_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_update_operations.py
deleted file mode 100644
index b35219b0a81e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_update_operations.py
+++ /dev/null
@@ -1,343 +0,0 @@
-# pylint: disable=too-many-lines
-# 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 sys
-from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
-from azure.core.tracing.decorator import distributed_trace
-from azure.core.utils import case_insensitive_dict
-from azure.mgmt.core.exceptions import ARMErrorFormat
-from azure.mgmt.core.polling.arm_polling import ARMPolling
-
-from .. import models as _models
-from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
-else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-_SERIALIZER = Serializer()
-_SERIALIZER.client_side_validation = False
-
-
-def build_recommendation_request(
- resource_group_name: str, workspace_name: str, recommendation_id: str, subscription_id: str, **kwargs: Any
-) -> HttpRequest:
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
- "resourceGroupName": _SERIALIZER.url(
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
- ),
- "workspaceName": _SERIALIZER.url(
- "workspace_name",
- workspace_name,
- "str",
- max_length=90,
- min_length=1,
- pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$",
- ),
- "recommendationId": _SERIALIZER.url("recommendation_id", recommendation_id, "str"),
- }
-
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-class UpdateOperations:
- """
- .. warning::
- **DO NOT** instantiate this class directly.
-
- Instead, you should access the following operations through
- :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
- :attr:`update` attribute.
- """
-
- models = _models
-
- def __init__(self, *args, **kwargs):
- input_args = list(args)
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
-
- def _recommendation_initial(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: Union[List[_models.RecommendationPatch], IO],
- **kwargs: Any
- ) -> _models.Recommendation:
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(recommendation_patch, (IO, bytes)):
- _content = recommendation_patch
- else:
- _json = self._serialize.body(recommendation_patch, "[RecommendationPatch]")
-
- request = build_recommendation_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- recommendation_id=recommendation_id,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self._recommendation_initial.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [202]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("Recommendation", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
-
- _recommendation_initial.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}"
- }
-
- @overload
- def begin_recommendation(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: List[_models.RecommendationPatch],
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> LROPoller[_models.Recommendation]:
- """Patch a recommendation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :param recommendation_patch: Recommendation Fields to Update. Required.
- :type recommendation_patch: list[~azure.mgmt.securityinsight.models.RecommendationPatch]
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
- operation to not poll, or pass in your own initialized polling object for a personal polling
- strategy.
- :paramtype polling: bool or ~azure.core.polling.PollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of LROPoller that returns either Recommendation or the result of
- cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.Recommendation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def begin_recommendation(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: IO,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> LROPoller[_models.Recommendation]:
- """Patch a recommendation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :param recommendation_patch: Recommendation Fields to Update. Required.
- :type recommendation_patch: IO
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
- operation to not poll, or pass in your own initialized polling object for a personal polling
- strategy.
- :paramtype polling: bool or ~azure.core.polling.PollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of LROPoller that returns either Recommendation or the result of
- cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.Recommendation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def begin_recommendation(
- self,
- resource_group_name: str,
- workspace_name: str,
- recommendation_id: str,
- recommendation_patch: Union[List[_models.RecommendationPatch], IO],
- **kwargs: Any
- ) -> LROPoller[_models.Recommendation]:
- """Patch a recommendation.
-
- :param resource_group_name: The name of the resource group. The name is case insensitive.
- Required.
- :type resource_group_name: str
- :param workspace_name: The name of the workspace. Required.
- :type workspace_name: str
- :param recommendation_id: Recommendation Id. Required.
- :type recommendation_id: str
- :param recommendation_patch: Recommendation Fields to Update. Is either a list type or a IO
- type. Required.
- :type recommendation_patch: list[~azure.mgmt.securityinsight.models.RecommendationPatch] or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
- :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
- operation to not poll, or pass in your own initialized polling object for a personal polling
- strategy.
- :paramtype polling: bool or ~azure.core.polling.PollingMethod
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
- Retry-After header is present.
- :return: An instance of LROPoller that returns either Recommendation or the result of
- cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.Recommendation]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
-
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
- polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
- if cont_token is None:
- raw_result = self._recommendation_initial(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- recommendation_id=recommendation_id,
- recommendation_patch=recommendation_patch,
- api_version=api_version,
- content_type=content_type,
- cls=lambda x, y, z: x,
- headers=_headers,
- params=_params,
- **kwargs
- )
- kwargs.pop("error_map", None)
-
- def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("Recommendation", pipeline_response)
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
-
- if polling is True:
- polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
- elif polling is False:
- polling_method = cast(PollingMethod, NoPolling())
- else:
- polling_method = polling
- if cont_token:
- return LROPoller.from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
-
- begin_recommendation.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlist_items_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlist_items_operations.py
index 1139c4e49331..ade138b909c0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlist_items_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlist_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,20 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -53,9 +51,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -64,7 +60,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -79,7 +75,7 @@ def build_list_request(
"watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -103,9 +99,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -114,7 +108,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -130,7 +124,7 @@ def build_get_request(
"watchlistItemId": _SERIALIZER.url("watchlist_item_id", watchlist_item_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -152,9 +146,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -163,7 +155,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -179,7 +171,7 @@ def build_delete_request(
"watchlistItemId": _SERIALIZER.url("watchlist_item_id", watchlist_item_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -201,9 +193,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -213,7 +203,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -229,7 +219,7 @@ def build_create_or_update_request(
"watchlistItemId": _SERIALIZER.url("watchlist_item_id", watchlist_item_id, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -270,21 +260,20 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> Iterable["_models.WatchlistItem"]:
- """Gets all watchlist Items.
+ """Get all watchlist Items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
:param skip_token: Skiptoken is only used if a previous operation returned a partial result. If
a previous response contains a nextLink element, the value of the nextLink element will include
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either WatchlistItem or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.WatchlistItem]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -292,12 +281,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WatchlistItemList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -308,19 +295,17 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
subscription_id=self._config.subscription_id,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -332,13 +317,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("WatchlistItemList", pipeline_response)
@@ -348,10 +332,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -363,31 +348,26 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
) -> _models.WatchlistItem:
- """Gets a watchlist, without its watchlist items.
+ """Get a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -398,27 +378,24 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WatchlistItem] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
watchlist_item_id=watchlist_item_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -427,16 +404,12 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("WatchlistItem", pipeline_response)
+ deserialized = self._deserialize("WatchlistItem", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
+ return deserialized # type: ignore
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
@@ -449,16 +422,15 @@ def delete( # pylint: disable=inconsistent-return-statements
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -469,27 +441,24 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_delete_request(
+ _request = build_delete_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
watchlist_item_id=watchlist_item_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -499,11 +468,7 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
-
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
+ return cls(pipeline_response, None, {}) # type: ignore
@overload
def create_or_update(
@@ -517,23 +482,22 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.WatchlistItem:
- """Creates or updates a watchlist item.
+ """Create or update a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
:param watchlist_item: The watchlist item. Required.
:type watchlist_item: ~azure.mgmt.securityinsight.models.WatchlistItem
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
@@ -546,28 +510,27 @@ def create_or_update(
workspace_name: str,
watchlist_alias: str,
watchlist_item_id: str,
- watchlist_item: IO,
+ watchlist_item: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.WatchlistItem:
- """Creates or updates a watchlist item.
+ """Create or update a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
:param watchlist_item: The watchlist item. Required.
- :type watchlist_item: IO
+ :type watchlist_item: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
@@ -580,31 +543,28 @@ def create_or_update(
workspace_name: str,
watchlist_alias: str,
watchlist_item_id: str,
- watchlist_item: Union[_models.WatchlistItem, IO],
+ watchlist_item: Union[_models.WatchlistItem, IO[bytes]],
**kwargs: Any
) -> _models.WatchlistItem:
- """Creates or updates a watchlist item.
+ """Create or update a watchlist item.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist_item_id: Watchlist Item Id (GUID). Required.
+ :param watchlist_item_id: The watchlist item id (GUID). Required.
:type watchlist_item_id: str
- :param watchlist_item: The watchlist item. Is either a model type or a IO type. Required.
- :type watchlist_item: ~azure.mgmt.securityinsight.models.WatchlistItem or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
+ :param watchlist_item: The watchlist item. Is either a WatchlistItem type or a IO[bytes] type.
+ Required.
+ :type watchlist_item: ~azure.mgmt.securityinsight.models.WatchlistItem or IO[bytes]
:return: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -615,21 +575,19 @@ def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.WatchlistItem] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(watchlist_item, (IO, bytes)):
+ if isinstance(watchlist_item, (IOBase, bytes)):
_content = watchlist_item
else:
_json = self._serialize.body(watchlist_item, "WatchlistItem")
- request = build_create_or_update_request(
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
@@ -639,15 +597,14 @@ def create_or_update(
content_type=content_type,
json=_json,
content=_content,
- template_url=self.create_or_update.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -656,17 +613,9 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("WatchlistItem", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("WatchlistItem", pipeline_response)
+ deserialized = self._deserialize("WatchlistItem", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
-
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlists_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlists_operations.py
index c675404d4edb..953ad1073b48 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlists_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_watchlists_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,8 +5,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -16,24 +16,26 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request, _format_url_section
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,9 +54,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -63,7 +63,7 @@ def build_list_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -77,7 +77,7 @@ def build_list_request(
),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -96,9 +96,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -107,7 +105,7 @@ def build_get_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -122,7 +120,7 @@ def build_get_request(
"watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -139,9 +137,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -150,7 +146,7 @@ def build_delete_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -165,7 +161,7 @@ def build_delete_request(
"watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -182,9 +178,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", "2022-12-01-preview")
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -194,7 +188,7 @@ def build_create_or_update_request(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}",
) # pylint: disable=line-too-long
path_format_arguments = {
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
@@ -209,7 +203,7 @@ def build_create_or_update_request(
"watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
}
- _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
+ _url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -245,7 +239,7 @@ def __init__(self, *args, **kwargs):
def list(
self, resource_group_name: str, workspace_name: str, skip_token: Optional[str] = None, **kwargs: Any
) -> Iterable["_models.Watchlist"]:
- """Gets all watchlists, without watchlist items.
+ """Get all watchlists, without watchlist items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
@@ -257,7 +251,6 @@ def list(
a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional.
Default value is None.
:type skip_token: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either Watchlist or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -265,12 +258,10 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WatchlistList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -281,18 +272,16 @@ def list(
def prepare_request(next_link=None):
if not next_link:
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
skip_token=skip_token,
api_version=api_version,
- template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
@@ -304,13 +293,12 @@ def prepare_request(next_link=None):
}
)
_next_request_params["api-version"] = self._config.api_version
- request = HttpRequest(
+ _request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
- request.method = "GET"
- return request
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("WatchlistList", pipeline_response)
@@ -320,10 +308,11 @@ def extract_data(pipeline_response):
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
- request = prepare_request(next_link)
+ _request = prepare_request(next_link)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -335,29 +324,24 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists"
- }
-
@distributed_trace
def get(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
) -> _models.Watchlist:
- """Gets a watchlist, without its watchlist items.
+ """Get a watchlist, without its watchlist items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :keyword callable cls: A custom type or function that will be passed the direct response
:return: Watchlist or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Watchlist
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -368,26 +352,23 @@ def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.Watchlist] = kwargs.pop("cls", None)
- request = build_get_request(
+ _request = build_get_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
@@ -396,21 +377,76 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("Watchlist", pipeline_response)
+ deserialized = self._deserialize("Watchlist", pipeline_response.http_response)
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- return deserialized
+ return deserialized # type: ignore
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
+ def _delete_initial(
+ self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_delete_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ watchlist_alias=watchlist_alias,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace
- def delete( # pylint: disable=inconsistent-return-statements
+ def begin_delete(
self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
- ) -> None:
+ ) -> LROPoller[None]:
"""Delete a watchlist.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -418,14 +454,64 @@ def delete( # pylint: disable=inconsistent-return-statements
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: None or the result of cls(response)
- :rtype: None
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ watchlist_alias=watchlist_alias,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ watchlist: Union[_models.Watchlist, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -433,52 +519,67 @@ def delete( # pylint: disable=inconsistent-return-statements
}
error_map.update(kwargs.pop("error_map", {}) or {})
- _headers = kwargs.pop("headers", {}) or {}
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
- cls: ClsType[None] = kwargs.pop("cls", None)
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
- request = build_delete_request(
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(watchlist, (IOBase, bytes)):
+ _content = watchlist
+ else:
+ _json = self._serialize.body(watchlist, "Watchlist")
+
+ _request = build_create_or_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
watchlist_alias=watchlist_alias,
subscription_id=self._config.subscription_id,
api_version=api_version,
- template_url=self.delete.metadata["url"],
+ content_type=content_type,
+ json=_json,
+ content=_content,
headers=_headers,
params=_params,
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ _request.url = self._client.format_url(_request.url)
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
- if response.status_code not in [200, 204]:
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
response_headers = {}
- if response.status_code == 200:
+ if response.status_code == 201:
response_headers["Azure-AsyncOperation"] = self._deserialize(
"str", response.headers.get("Azure-AsyncOperation")
)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, response_headers)
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
+ return deserialized # type: ignore
@overload
- def create_or_update(
+ def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
@@ -487,168 +588,132 @@ def create_or_update(
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.Watchlist:
+ ) -> LROPoller[_models.Watchlist]:
"""Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv
- content type). To create a Watchlist and its Items, we should call this endpoint with either
- rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for
- small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large
- watchlist, where the content size can go up to 500 MB. The status of processing such large file
- can be polled through the URL returned in Azure-AsyncOperation header.
+ content type). To create a Watchlist and its Items, we should call this endpoint with
+ rawContent and contentType properties.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
:param watchlist: The watchlist. Required.
:type watchlist: ~azure.mgmt.securityinsight.models.Watchlist
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Watchlist or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Watchlist
+ :return: An instance of LROPoller that returns either Watchlist or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- def create_or_update(
+ def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
watchlist_alias: str,
- watchlist: IO,
+ watchlist: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> _models.Watchlist:
+ ) -> LROPoller[_models.Watchlist]:
"""Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv
- content type). To create a Watchlist and its Items, we should call this endpoint with either
- rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for
- small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large
- watchlist, where the content size can go up to 500 MB. The status of processing such large file
- can be polled through the URL returned in Azure-AsyncOperation header.
+ content type). To create a Watchlist and its Items, we should call this endpoint with
+ rawContent and contentType properties.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
:param watchlist: The watchlist. Required.
- :type watchlist: IO
+ :type watchlist: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Watchlist or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Watchlist
+ :return: An instance of LROPoller that returns either Watchlist or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
- def create_or_update(
+ def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
watchlist_alias: str,
- watchlist: Union[_models.Watchlist, IO],
+ watchlist: Union[_models.Watchlist, IO[bytes]],
**kwargs: Any
- ) -> _models.Watchlist:
+ ) -> LROPoller[_models.Watchlist]:
"""Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv
- content type). To create a Watchlist and its Items, we should call this endpoint with either
- rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for
- small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large
- watchlist, where the content size can go up to 500 MB. The status of processing such large file
- can be polled through the URL returned in Azure-AsyncOperation header.
+ content type). To create a Watchlist and its Items, we should call this endpoint with
+ rawContent and contentType properties.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
- :param watchlist_alias: Watchlist Alias. Required.
+ :param watchlist_alias: The watchlist alias. Required.
:type watchlist_alias: str
- :param watchlist: The watchlist. Is either a model type or a IO type. Required.
- :type watchlist: ~azure.mgmt.securityinsight.models.Watchlist or IO
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
- Default value is None.
- :paramtype content_type: str
- :keyword callable cls: A custom type or function that will be passed the direct response
- :return: Watchlist or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.Watchlist
+ :param watchlist: The watchlist. Is either a Watchlist type or a IO[bytes] type. Required.
+ :type watchlist: ~azure.mgmt.securityinsight.models.Watchlist or IO[bytes]
+ :return: An instance of LROPoller that returns either Watchlist or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.securityinsight.models.Watchlist]
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: Literal["2022-12-01-preview"] = kwargs.pop(
- "api_version", _params.pop("api-version", self._config.api_version)
- )
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.Watchlist] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(watchlist, (IO, bytes)):
- _content = watchlist
- else:
- _json = self._serialize.body(watchlist, "Watchlist")
-
- request = build_create_or_update_request(
- resource_group_name=resource_group_name,
- workspace_name=workspace_name,
- watchlist_alias=watchlist_alias,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- template_url=self.create_or_update.metadata["url"],
- headers=_headers,
- params=_params,
- )
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200, 201]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- response_headers = {}
- if response.status_code == 200:
- deserialized = self._deserialize("Watchlist", pipeline_response)
-
- if response.status_code == 201:
- response_headers["Azure-AsyncOperation"] = self._deserialize(
- "str", response.headers.get("Azure-AsyncOperation")
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ watchlist_alias=watchlist_alias,
+ watchlist=watchlist,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
)
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
- deserialized = self._deserialize("Watchlist", pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
-
- return deserialized # type: ignore
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("Watchlist", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.Watchlist].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.Watchlist](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_action_of_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/create_action_of_alert_rule.py
similarity index 95%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_action_of_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/create_action_of_alert_rule.py
index 805f96e8a4ec..2d73b08200b7 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_action_of_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/create_action_of_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -45,6 +46,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/actions/CreateActionOfAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/actions/CreateActionOfAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_action_of_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/delete_action_of_alert_rule.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_action_of_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/delete_action_of_alert_rule.py
index 01907457a01d..f49d7999eda8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_action_of_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/delete_action_of_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,15 +30,14 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.actions.delete(
+ client.actions.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
action_id="912bec42-cb66-4c03-ac63-1761b6898c3e",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/actions/DeleteActionOfAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/actions/DeleteActionOfAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_action_of_alert_rule_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/get_action_of_alert_rule_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_action_of_alert_rule_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/get_action_of_alert_rule_by_id.py
index 6bf9693e038f..02972296fe56 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_action_of_alert_rule_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/get_action_of_alert_rule_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/actions/GetActionOfAlertRuleById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/actions/GetActionOfAlertRuleById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_actions_by_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/get_all_actions_by_alert_rule.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_actions_by_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/get_all_actions_by_alert_rule.py
index 71e28322c8e7..76691dbf412d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_actions_by_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/actions/get_all_actions_by_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/actions/GetAllActionsByAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/actions/GetAllActionsByAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_alert_rule_template_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rule_templates/get_alert_rule_template_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_alert_rule_template_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rule_templates/get_alert_rule_template_by_id.py
index 1d18bbcb0164..161009422940 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_alert_rule_template_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rule_templates/get_alert_rule_template_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRuleTemplates/GetAlertRuleTemplateById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_alert_rule_templates.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rule_templates/get_alert_rule_templates.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_alert_rule_templates.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rule_templates/get_alert_rule_templates.py
index 4f232d8a66d2..e162cb489670 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_alert_rule_templates.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rule_templates/get_alert_rule_templates.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRuleTemplates/GetAlertRuleTemplates.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_team.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule.py
similarity index 76%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_team.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule.py
index 6f3462eb2a73..f62f5d24d23a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_team.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_create_team.py
+ python create_fusion_alert_rule.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,20 +30,19 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.incidents.create_team(
+ response = client.alert_rules.create_or_update(
resource_group_name="myRg",
workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
- team_properties={
- "groupIds": None,
- "memberIds": None,
- "teamDescription": "Team description",
- "teamName": "Team name",
+ rule_id="myFirstFusionRule",
+ alert_rule={
+ "etag": "3d00c3ca-0000-0100-0000-5d42d5010000",
+ "kind": "Fusion",
+ "properties": {"alertRuleTemplateName": "f71aba3d-28fb-450b-b192-4e76a83015c8", "enabled": True},
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentTeam/Incidents_CreateTeam.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/CreateFusionAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_microsoft_security_incident_creation_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_microsoft_security_incident_creation_alert_rule.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_microsoft_security_incident_creation_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_microsoft_security_incident_creation_alert_rule.py
index f1dae6d1fced..cd46e63fdc3e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_microsoft_security_incident_creation_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_microsoft_security_incident_creation_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -46,6 +47,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_scheduled_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_scheduled_alert_rule.py
similarity index 94%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_scheduled_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_scheduled_alert_rule.py
index 41f7815cc6e8..64592aed635e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_scheduled_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_scheduled_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -70,12 +71,10 @@ def main():
"query": "Heartbeat",
"queryFrequency": "PT1H",
"queryPeriod": "P2DT1H30M",
- "sentinelEntitiesMappings": [{"columnName": "Entities"}],
"severity": "High",
"suppressionDuration": "PT1H",
"suppressionEnabled": False,
"tactics": ["Persistence", "LateralMovement"],
- "techniques": ["T1037", "T1021"],
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
},
@@ -84,6 +83,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/CreateScheduledAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/CreateScheduledAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/delete_alert_rule.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/delete_alert_rule.py
index e8eccd69f4ac..fe94aec84f7b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/delete_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.alert_rules.delete(
+ client.alert_rules.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/DeleteAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/DeleteAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_alert_rules.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_all_alert_rules.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_alert_rules.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_all_alert_rules.py
index 6bfe39da69fe..ef50df344198 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_alert_rules.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_all_alert_rules.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/GetAllAlertRules.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/GetAllAlertRules.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_fusion_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_fusion_alert_rule.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_fusion_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_fusion_alert_rule.py
index 20bbac08277f..9173557689ea 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_fusion_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_fusion_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/GetFusionAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/GetFusionAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_security_incident_creation_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_microsoft_security_incident_creation_alert_rule.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_security_incident_creation_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_microsoft_security_incident_creation_alert_rule.py
index fd1493e29bb6..fe60d6b87fc0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_security_incident_creation_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_microsoft_security_incident_creation_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_scheduled_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_scheduled_alert_rule.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_scheduled_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_scheduled_alert_rule.py
index fe0d97781a54..d62725ef707e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_scheduled_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_scheduled_alert_rule.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/GetScheduledAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/alertRules/GetScheduledAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_create_or_update.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_create_or_update.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_create_or_update.py
index 41e25ad33c82..e38712f2428b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_create_or_update.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_create_or_update.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/automationRules/AutomationRules_CreateOrUpdate.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_delete.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_delete.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_delete.py
index 5425a32f6ccd..0f369b3679ee 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_delete.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/automationRules/AutomationRules_Delete.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/automationRules/AutomationRules_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_get.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_get.py
index 56075cbd2de2..0efc0926ec3b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_get.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/automationRules/AutomationRules_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/automationRules/AutomationRules_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_list.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_list.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_list.py
index 5916a50c7a2a..ae77a4171a81 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/automation_rules/automation_rules_list.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/automationRules/AutomationRules_List.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/automationRules/AutomationRules_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/create_bookmark.py
similarity index 80%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/create_bookmark.py
index 44e578eca8d0..cca687e158b8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/create_bookmark.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -36,22 +37,14 @@ def main():
bookmark={
"etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
"properties": {
- "created": "2021-09-01T13:15:30Z",
+ "created": "2019-01-01T13:15:30Z",
"createdBy": {"objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70"},
"displayName": "My bookmark",
- "entityMappings": [
- {
- "entityType": "Account",
- "fieldMappings": [{"identifier": "Fullname", "value": "johndoe@microsoft.com"}],
- }
- ],
"labels": ["Tag1", "Tag2"],
"notes": "Found a suspicious activity",
"query": "SecurityEvent | where TimeGenerated > ago(1d) and TimeGenerated < ago(2d)",
"queryResult": "Security Event query result",
- "tactics": ["Execution"],
- "techniques": ["T1609"],
- "updated": "2021-09-01T13:15:30Z",
+ "updated": "2019-01-01T13:15:30Z",
"updatedBy": {"objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70"},
},
},
@@ -59,6 +52,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/CreateBookmark.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/bookmarks/CreateBookmark.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/delete_bookmark.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/delete_bookmark.py
index 5f63071b1758..ce74a7d212e8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/delete_bookmark.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.bookmarks.delete(
+ client.bookmarks.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
bookmark_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/DeleteBookmark.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/bookmarks/DeleteBookmark.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/get_bookmark_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/get_bookmark_by_id.py
index 8e87468ceb1e..fab430d77732 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/get_bookmark_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/GetBookmarkById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/bookmarks/GetBookmarkById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmarks.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/get_bookmarks.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmarks.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/get_bookmarks.py
index 3bfe6238bf16..600b5c66302e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmarks.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/get_bookmarks.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/GetBookmarks.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/bookmarks/GetBookmarks.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling.py
deleted file mode 100644
index 2a05669c46df..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling.py
+++ /dev/null
@@ -1,54 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python connect_api_polling.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.connect(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- connect_body={
- "apiKey": "123456789",
- "kind": "APIKey",
- "requestConfigUserInputValues": [
- {
- "displayText": "Organization Name",
- "placeHolderName": "{{placeHolder1}}",
- "placeHolderValue": "somePlaceHolderValue",
- "requestObjectKey": "apiEndpoint",
- }
- ],
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/ConnectAPIPolling.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling_v2_logs.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling_v2_logs.py
deleted file mode 100644
index f63f252194af..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling_v2_logs.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python connect_api_polling_v2_logs.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.connect(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- connect_body={
- "apiKey": "123456789",
- "dataCollectionEndpoint": "https://test.eastus.ingest.monitor.azure.com",
- "dataCollectionRuleImmutableId": "dcr-34adsj9o7d6f9de204478b9cgb43b631",
- "kind": "APIKey",
- "outputStream": "Custom-MyTableRawData",
- "requestConfigUserInputValues": [
- {
- "displayText": "Organization Name",
- "placeHolderName": "{{placeHolder1}}",
- "placeHolderValue": "somePlaceHolderValue",
- "requestObjectKey": "apiEndpoint",
- }
- ],
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/ConnectAPIPollingV2Logs.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_eyes_on_setting.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_package_by_id.py
similarity index 82%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_eyes_on_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_package_by_id.py
index 631125a81101..5aa06c5f8fcd 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_eyes_on_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_package_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_eyes_on_setting.py
+ python get_package_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,17 +27,17 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.product_settings.get(
+ response = client.content_packages.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- settings_name="EyesOn",
+ package_id="str.azure-sentinel-solution-str",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/settings/GetEyesOnSetting.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentPackages/GetPackageById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_imports.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_packages.py
similarity index 85%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_imports.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_packages.py
index 453ebae65bdc..d0aa88b08a2a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_imports.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_packages.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_file_imports.py
+ python get_packages.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,10 +27,10 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.file_imports.list(
+ response = client.content_packages.list(
resource_group_name="myRg",
workspace_name="myWorkspace",
)
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/fileImports/GetFileImports.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentPackages/GetPackages.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_account_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_package_by_id.py
similarity index 81%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_account_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_package_by_id.py
index 4cdf7445de26..6af46c81bc9d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_account_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_package_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_account_entity_by_id.py
+ python get_product_package_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,17 +27,17 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.entities.get(
+ response = client.product_package.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ package_id="str.azure-sentinel-solution-str",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetAccountEntityById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentPackages/GetProductPackageById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_queries.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_packages.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_queries.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_packages.py
index 8cee24ba1398..436d7325c680 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_queries.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_packages.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_entity_queries.py
+ python get_product_packages.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,10 +27,10 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.entity_queries.list(
+ response = client.product_packages.list(
resource_group_name="myRg",
workspace_name="myWorkspace",
)
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueries/GetEntityQueries.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentPackages/GetProductPackages.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_power_bi_data_connector.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/install_package.py
similarity index 68%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_power_bi_data_connector.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/install_package.py
index c2c0e69ee1c2..8a06f104cf9b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_power_bi_data_connector.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/install_package.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python create_office_power_bi_data_connector.py
+ python install_package.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,25 +27,27 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.data_connectors.create_or_update(
+ response = client.content_package.install(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- data_connector={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "OfficePowerBI",
+ package_id="str.azure-sentinel-solution-str",
+ package_installation_properties={
"properties": {
- "dataTypes": {"logs": {"state": "Enabled"}},
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
+ "contentId": "str.azure-sentinel-solution-str",
+ "contentKind": "Solution",
+ "contentProductId": "str.azure-sentinel-solution-str-sl-igl6jawr4gwmu",
+ "displayName": "str",
+ "version": "2.0.0",
},
+ "tags": {"tag1": "str"},
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateOfficePowerBIDataConnector.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentPackages/InstallPackage.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/uninstall_package.py
similarity index 82%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/uninstall_package.py
index 049b5a6b8a82..d979736e20d2 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/uninstall_package.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_recommendations.py
+ python uninstall_package.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,16 +27,16 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.get_recommendations.list(
+ client.content_package.uninstall(
resource_group_name="myRg",
workspace_name="myWorkspace",
+ package_id="str.azure-sentinel-solution-str",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/recommendations/GetRecommendations.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentPackages/UninstallPackage.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/delete_template.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/delete_template.py
new file mode 100644
index 000000000000..dbd5372f6e3a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/delete_template.py
@@ -0,0 +1,42 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python delete_template.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = SecurityInsights(
+ credential=DefaultAzureCredential(),
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
+ )
+
+ client.content_template.delete(
+ resource_group_name="myRg",
+ workspace_name="myWorkspace",
+ template_id="8365ebfe-a381-45b7-ad08-7d818070e11f",
+ )
+
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentTemplates/DeleteTemplate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_entity_query.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_template_by_id.py
similarity index 81%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_entity_query.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_template_by_id.py
index a65893898988..8b52010072a0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_entity_query.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_template_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python delete_entity_query.py
+ python get_product_template_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,17 +27,17 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.entity_queries.delete(
+ response = client.product_template.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
+ template_id="8365ebfe-a381-45b7-ad08-7d818070e11f",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueries/DeleteEntityQuery.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentTemplates/GetProductTemplateById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_templates.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_templates.py
index 047adb41a559..303768e4f7ea 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_templates.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_office_consents.py
+ python get_product_templates.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,10 +27,10 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.office_consents.list(
+ response = client.product_templates.list(
resource_group_name="myRg",
workspace_name="myWorkspace",
)
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/officeConsents/GetOfficeConsents.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentTemplates/GetProductTemplates.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_eyes_on_setting.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_template_by_id.py
similarity index 81%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_eyes_on_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_template_by_id.py
index 599eaa20379e..76e5239fcfd7 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_eyes_on_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_template_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python delete_eyes_on_setting.py
+ python get_template_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,17 +27,17 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
)
- response = client.product_settings.delete(
+ response = client.content_template.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- settings_name="EyesOn",
+ template_id="8365ebfe-a381-45b7-ad08-7d818070e11f",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/settings/DeleteEyesOnSetting.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentTemplates/GetTemplateById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_templates.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_templates.py
new file mode 100644
index 000000000000..164fb9d7193e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_templates.py
@@ -0,0 +1,43 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_templates.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = SecurityInsights(
+ credential=DefaultAzureCredential(),
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
+ )
+
+ response = client.content_templates.list(
+ resource_group_name="myRg",
+ workspace_name="myWorkspace",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentTemplates/GetTemplates.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/install_template.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/install_template.py
new file mode 100644
index 000000000000..0ed3aa5cb246
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/install_template.py
@@ -0,0 +1,116 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python install_template.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = SecurityInsights(
+ credential=DefaultAzureCredential(),
+ subscription_id="d0cfeab2-9ae0-4464-9919-dccaee2e48f0",
+ )
+
+ response = client.content_template.install(
+ resource_group_name="myRg",
+ workspace_name="myWorkspace",
+ template_id="str.azure-sentinel-solution-str",
+ template_installation_properties={
+ "properties": {
+ "author": {"email": "support@microsoft.com", "name": "Microsoft"},
+ "contentId": "8365ebfe-a381-45b7-ad08-7d818070e11f",
+ "contentKind": "AnalyticsRule",
+ "contentProductId": "str.azure-sentinel-solution-str-ar-cbfe4fndz66bi",
+ "displayName": "API Protection workbook template",
+ "mainTemplate": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.1",
+ "resources": [
+ {
+ "apiVersion": "2022-04-01-preview",
+ "kind": "Scheduled",
+ "location": "[parameters('workspace-location')]",
+ "name": "8365ebfe-a381-45b7-ad08-7d818070e11f",
+ "properties": {
+ "description": "Creates an incident when a large number of Critical/High severity CrowdStrike Falcon sensor detections is triggered by a single user",
+ "displayName": "Critical or High Severity Detections by User",
+ "enabled": False,
+ "query": "...",
+ "queryFrequency": "PT1H",
+ "queryPeriod": "PT1H",
+ "severity": "High",
+ "status": "Available",
+ "suppressionDuration": "PT1H",
+ "suppressionEnabled": False,
+ "triggerOperator": "GreaterThan",
+ "triggerThreshold": 0,
+ },
+ "type": "Microsoft.SecurityInsights/AlertRuleTemplates",
+ },
+ {
+ "apiVersion": "2022-01-01-preview",
+ "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',concat('AnalyticsRule-', last(split([resourceId('Microsoft.SecurityInsights/AlertRuleTemplates', 8365ebfe-a381-45b7-ad08-7d818070e11f)],'/'))))]",
+ "properties": {
+ "author": {"email": "support@microsoft.com", "name": "Microsoft"},
+ "contentId": "4465ebde-b381-45f7-ad08-7d818070a11c",
+ "description": "CrowdStrike Falcon Endpoint Protection Analytics Rule 1",
+ "kind": "AnalyticsRule",
+ "parentId": "[resourceId('Microsoft.SecurityInsights/AlertRuleTemplates', 8365ebfe-a381-45b7-ad08-7d818070e11f)]",
+ "source": {
+ "kind": "Solution",
+ "name": "str",
+ "sourceId": "str.azure-sentinel-solution-str",
+ },
+ "support": {
+ "email": "support@microsoft.com",
+ "link": "https://support.microsoft.com/",
+ "name": "Microsoft Corporation",
+ "tier": "Microsoft",
+ },
+ "version": "1.0.0",
+ },
+ "type": "Microsoft.OperationalInsights/workspaces/providers/metadata",
+ },
+ ],
+ },
+ "packageId": "str.azure-sentinel-solution-str",
+ "packageKind": "Solution",
+ "packageName": "str",
+ "packageVersion": "1.0.0",
+ "source": {"kind": "Solution", "name": "str", "sourceId": "str.azure-sentinel-solution-str"},
+ "support": {
+ "email": "support@microsoft.com",
+ "link": "https://support.microsoft.com/",
+ "name": "Microsoft Corporation",
+ "tier": "Microsoft",
+ },
+ "version": "1.0.1",
+ },
+ "tags": {"tag1": "str"},
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/contentTemplates/InstallTemplate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark_relation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark_relation.py
deleted file mode 100644
index fa4c8433745e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark_relation.py
+++ /dev/null
@@ -1,48 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_bookmark_relation.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.bookmark_relations.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="2216d0e1-91e3-4902-89fd-d2df8c535096",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
- relation={
- "properties": {
- "relatedResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812"
- }
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_entity_query_activity.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_entity_query_activity.py
deleted file mode 100644
index 0d31fbd40726..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_entity_query_activity.py
+++ /dev/null
@@ -1,64 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_entity_query_activity.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entity_queries.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
- entity_query={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "Activity",
- "properties": {
- "content": "On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'",
- "description": "Account deleted on host",
- "enabled": True,
- "entitiesFilter": {"Host_OsFamily": ["Windows"]},
- "inputEntityType": "Host",
- "queryDefinitions": {
- "query": "let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string, v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\nSecurityEvent\n| where EventID in (4725, 4726, 4767, 4720, 4722, 4723, 4724)\n// parsing for Host to handle variety of conventions coming from data\n| extend Host_HostName = case(\nComputer has '@', tostring(split(Computer, '@')[0]),\nComputer has '\\\\', tostring(split(Computer, '\\\\')[1]),\nComputer has '.', tostring(split(Computer, '.')[0]),\nComputer\n)\n| extend Host_NTDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', tostring(split(Computer, '.')[-2]), \nComputer\n)\n| extend Host_DnsDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \nComputer\n)\n| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \nor (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \nor v_Host_AzureID =~ _ResourceId \nor v_Host_OMSAgentID == SourceComputerId\n| project TimeGenerated, EventID, Activity, Computer, TargetAccount, TargetUserName, TargetDomainName, TargetSid, SubjectUserName, SubjectUserSid, _ResourceId, SourceComputerId\n| extend AddedBy = SubjectUserName\n// Future support for Activities\n| extend timestamp = TimeGenerated, HostCustomEntity = Computer, AccountCustomEntity = TargetAccount\n};\nGetAccountActions('{{Host_HostName}}', '{{Host_NTDomain}}', '{{Host_DnsDomain}}', '{{Host_AzureID}}', '{{Host_OMSAgentID}}')\n \n| where EventID == 4726 "
- },
- "requiredInputFieldsSets": [
- ["Host_HostName", "Host_NTDomain"],
- ["Host_HostName", "Host_DnsDomain"],
- ["Host_AzureID"],
- ["Host_OMSAgentID"],
- ],
- "templateName": None,
- "title": "An account was deleted on this host",
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueries/CreateEntityQueryActivity.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_file_import.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_file_import.py
deleted file mode 100644
index 9a9744fd6ec9..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_file_import.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_file_import.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.file_imports.create(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- file_import_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- file_import={
- "properties": {
- "contentType": "StixIndicator",
- "importFile": {"fileFormat": "JSON", "fileName": "myFile.json", "fileSize": 4653},
- "ingestionMode": "IngestAnyValidRecords",
- "source": "mySource",
- }
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/fileImports/CreateFileImport.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_fusion_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_fusion_alert_rule.py
deleted file mode 100644
index 7f4268b32cbc..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_fusion_alert_rule.py
+++ /dev/null
@@ -1,179 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_fusion_alert_rule.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.alert_rules.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="myFirstFusionRule",
- alert_rule={
- "etag": "3d00c3ca-0000-0100-0000-5d42d5010000",
- "kind": "Fusion",
- "properties": {
- "alertRuleTemplateName": "f71aba3d-28fb-450b-b192-4e76a83015c8",
- "enabled": True,
- "sourceSettings": [
- {"enabled": True, "sourceName": "Anomalies", "sourceSubTypes": None},
- {
- "enabled": True,
- "sourceName": "Alert providers",
- "sourceSubTypes": [
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Active Directory Identity Protection",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Defender",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Defender for IoT",
- },
- {
- "enabled": True,
- "severityFilter": ["High", "Medium", "Low", "Informational"],
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft 365 Defender",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Cloud App Security",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Defender for Endpoint",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Defender for Identity",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Defender for Office 365",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Sentinel scheduled analytics rules",
- },
- ],
- },
- {
- "enabled": True,
- "sourceName": "Raw logs from other sources",
- "sourceSubTypes": [
- {
- "enabled": True,
- "severityFilters": {"filters": None},
- "sourceSubTypeName": "Palo Alto Networks",
- }
- ],
- },
- ],
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/CreateFusionAlertRule.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_fusion_alert_rule_with_fusion_scenario_exclusion.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_fusion_alert_rule_with_fusion_scenario_exclusion.py
deleted file mode 100644
index cea2c133fe51..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_fusion_alert_rule_with_fusion_scenario_exclusion.py
+++ /dev/null
@@ -1,179 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_fusion_alert_rule_with_fusion_scenario_exclusion.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.alert_rules.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="myFirstFusionRule",
- alert_rule={
- "etag": "3d00c3ca-0000-0100-0000-5d42d5010000",
- "kind": "Fusion",
- "properties": {
- "alertRuleTemplateName": "f71aba3d-28fb-450b-b192-4e76a83015c8",
- "enabled": True,
- "sourceSettings": [
- {"enabled": True, "sourceName": "Anomalies", "sourceSubTypes": None},
- {
- "enabled": True,
- "sourceName": "Alert providers",
- "sourceSubTypes": [
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Active Directory Identity Protection",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Defender",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Defender for IoT",
- },
- {
- "enabled": True,
- "severityFilter": ["High", "Medium", "Low", "Informational"],
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft 365 Defender",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Cloud App Security",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Defender for Endpoint",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Defender for Identity",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Microsoft Defender for Office 365",
- },
- {
- "enabled": True,
- "severityFilters": {
- "filters": [
- {"enabled": True, "severity": "High"},
- {"enabled": True, "severity": "Medium"},
- {"enabled": True, "severity": "Low"},
- {"enabled": True, "severity": "Informational"},
- ]
- },
- "sourceSubTypeName": "Azure Sentinel scheduled analytics rules",
- },
- ],
- },
- {
- "enabled": True,
- "sourceName": "Raw logs from other sources",
- "sourceSubTypes": [
- {
- "enabled": True,
- "severityFilters": {"filters": None},
- "sourceSubTypeName": "Palo Alto Networks",
- }
- ],
- },
- ],
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_generic_ui.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_generic_ui.py
deleted file mode 100644
index b28a4a25f666..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_generic_ui.py
+++ /dev/null
@@ -1,161 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_generic_ui.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- data_connector={
- "kind": "GenericUI",
- "properties": {
- "connectorUiConfig": {
- "availability": {"isPreview": True, "status": 1},
- "connectivityCriteria": [
- {
- "type": "IsConnectedQuery",
- "value": [
- "{{graphQueriesTableName}}\n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)"
- ],
- }
- ],
- "dataTypes": [
- {
- "lastDataReceivedQuery": "{{graphQueriesTableName}}\n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)",
- "name": "{{graphQueriesTableName}}",
- }
- ],
- "descriptionMarkdown": "The [Qualys Vulnerability Management (VM)](https://www.qualys.com/apps/vulnerability-management/) data connector provides the capability to ingest vulnerability host detection data into Azure Sentinel through the Qualys API. The connector provides visibility into host detection data from vulerability scans. This connector provides Azure Sentinel the capability to view dashboards, create custom alerts, and improve investigation ",
- "graphQueries": [
- {
- "baseQuery": "{{graphQueriesTableName}}",
- "legend": "{{graphQueriesTableName}}",
- "metricName": "Total data received",
- }
- ],
- "graphQueriesTableName": "QualysHostDetection_CL",
- "instructionSteps": [
- {
- "description": "..\n\n **NOTE:** This connector uses Azure Functions to connect to Qualys VM to pull its logs into Azure Sentinel. This might result in additional data ingestion costs. Check the `Azure Functions pricing page `_ for details.",
- "title": "",
- },
- {
- "description": "..\n\n **(Optional Step)** Securely store workspace and API authorization key(s) or token(s) in Azure Key Vault. Azure Key Vault provides a secure mechanism to store and retrieve key values. `Follow these instructions `_ to use Azure Key Vault with an Azure Function App.",
- "title": "",
- },
- {
- "description": "**STEP 1 - Configuration steps for the Qualys VM API**\n\n\n#. Log into the Qualys Vulnerability Management console with an administrator account, select the **Users** tab and the **Users** subtab. \n#. Click on the **New** drop-down menu and select **Users..**\n#. Create a username and password for the API account. \n#. In the **User Roles** tab, ensure the account role is set to **Manager** and access is allowed to **GUI** and **API**\n#. Log out of the administrator account and log into the console with the new API credentials for validation, then log out of the API account. \n#. Log back into the console using an administrator account and modify the API accounts User Roles, removing access to **GUI**. \n#. Save all changes.",
- "title": "",
- },
- {
- "description": "**STEP 2 - Choose ONE from the following two deployment options to deploy the connector and the associated Azure Function**\n\n..\n\n **IMPORTANT:** Before deploying the Qualys VM connector, have the Workspace ID and Workspace Primary Key (can be copied from the following), as well as the Qualys VM API Authorization Key(s), readily available.",
- "instructions": [
- {
- "parameters": {"fillWith": ["WorkspaceId"], "label": "Workspace ID"},
- "type": "CopyableLabel",
- },
- {
- "parameters": {"fillWith": ["PrimaryKey"], "label": "Primary Key"},
- "type": "CopyableLabel",
- },
- ],
- "title": "",
- },
- {
- "description": 'Use this method for automated deployment of the Qualys VM connector using an ARM Tempate.\n\n\n#. \n Click the **Deploy to Azure** button below. \n\n \n .. image:: https://aka.ms/deploytoazurebutton\n :target: https://aka.ms/sentinelqualysvmazuredeploy\n :alt: Deploy To Azure\n\n\n#. Select the preferred **Subscription**\\ , **Resource Group** and **Location**. \n#. Enter the **Workspace ID**\\ , **Workspace Key**\\ , **API Username**\\ , **API Password** , update the **URI**\\ , and any additional URI **Filter Parameters** (each filter should be separated by an "&" symbol, no spaces.) \n ..\n\n * Enter the URI that corresponds to your region. The complete list of API Server URLs can be `found here `_ -- There is no need to add a time suffix to the URI, the Function App will dynamically append the Time Value to the URI in the proper format. \n * The default **Time Interval** is set to pull the last five (5) minutes of data. If the time interval needs to be modified, it is recommended to change the Function App Timer Trigger accordingly (in the function.json file, post deployment) to prevent overlapping data ingestion. \n * Note: If using Azure Key Vault secrets for any of the values above, use the\\ ``@Microsoft.KeyVault(SecretUri={Security Identifier})``\\ schema in place of the string values. Refer to `Key Vault references documentation `_ for further details. \n\n\n#. Mark the checkbox labeled **I agree to the terms and conditions stated above**. \n#. Click **Purchase** to deploy.',
- "title": "Option 1 - Azure Resource Manager (ARM) Template",
- },
- {
- "description": "Use the following step-by-step instructions to deploy the Quayls VM connector manually with Azure Functions.",
- "title": "Option 2 - Manual Deployment of Azure Functions",
- },
- {
- "description": "**1. Create a Function App**\n\n\n#. From the Azure Portal, navigate to `Function App `_\\ , and select **+ Add**.\n#. In the **Basics** tab, ensure Runtime stack is set to **Powershell Core**. \n#. In the **Hosting** tab, ensure the **Consumption (Serverless)** plan type is selected.\n#. Make other preferrable configuration changes, if needed, then click **Create**.",
- "title": "",
- },
- {
- "description": "**2. Import Function App Code**\n\n\n#. In the newly created Function App, select **Functions** on the left pane and click **+ New Function**.\n#. Select **Timer Trigger**.\n#. Enter a unique Function **Name** and leave the default cron schedule of every 5 minutes, then click **Create**.\n#. Click on **Code + Test** on the left pane. \n#. Copy the `Function App Code `_ and paste into the Function App ``run.ps1`` editor.\n#. Click **Save**.",
- "title": "",
- },
- {
- "description": '**3. Configure the Function App**\n\n\n#. In the Function App, select the Function App Name and select **Configuration**.\n#. In the **Application settings** tab, select **+ New application setting**.\n#. Add each of the following seven (7) application settings individually, with their respective string values (case-sensitive): \n .. code-block::\n\n apiUsername\n apiPassword\n workspaceID\n workspaceKey\n uri\n filterParameters\n timeInterval\n\n ..\n\n * Enter the URI that corresponds to your region. The complete list of API Server URLs can be `found here `_. The ``uri`` value must follow the following schema: ``https:///api/2.0/fo/asset/host/vm/detection/?action=list&vm_processed_after=`` -- There is no need to add a time suffix to the URI, the Function App will dynamically append the Time Value to the URI in the proper format.\n * Add any additional filter parameters, for the ``filterParameters`` variable, that need to be appended to the URI. Each parameter should be seperated by an "&" symbol and should not include any spaces.\n * Set the ``timeInterval`` (in minutes) to the value of ``5`` to correspond to the Timer Trigger of every ``5`` minutes. If the time interval needs to be modified, it is recommended to change the Function App Timer Trigger accordingly to prevent overlapping data ingestion.\n * Note: If using Azure Key Vault, use the\\ ``@Microsoft.KeyVault(SecretUri={Security Identifier})``\\ schema in place of the string values. Refer to `Key Vault references documentation `_ for further details.\n\n\n#. Once all application settings have been entered, click **Save**.',
- "title": "",
- },
- {
- "description": '**4. Configure the host.json**.\n\nDue to the potentially large amount of Qualys host detection data being ingested, it can cause the execution time to surpass the default Function App timeout of five (5) minutes. Increase the default timeout duration to the maximum of ten (10) minutes, under the Consumption Plan, to allow more time for the Function App to execute.\n\n\n#. In the Function App, select the Function App Name and select the **App Service Editor** blade.\n#. Click **Go** to open the editor, then select the **host.json** file under the **wwwroot** directory.\n#. Add the line ``"functionTimeout": "00:10:00",`` above the ``managedDependancy`` line \n#. Ensure **SAVED** appears on the top right corner of the editor, then exit the editor.\n\n..\n\n NOTE: If a longer timeout duration is required, consider upgrading to an `App Service Plan `_',
- "title": "",
- },
- ],
- "permissions": {
- "customs": [
- {
- "description": "Read and write permissions to Azure Functions to create a Function App is required. `See the documentation to learn more about Azure Functions `_.",
- "name": "Microsoft.Web/sites permissions",
- },
- {
- "description": "A Qualys VM API username and password is required. `See the documentation to learn more about Qualys VM API `_.",
- "name": "Qualys API Key",
- },
- ],
- "resourceProvider": [
- {
- "permissionsDisplayText": "read and write permissions on the workspace are required.",
- "provider": "Microsoft.OperationalInsights/workspaces",
- "providerDisplayName": "Workspace",
- "requiredPermissions": {"delete": True, "read": True, "write": True},
- "scope": "Workspace",
- },
- {
- "permissionsDisplayText": "read permissions to shared keys for the workspace are required. [See the documentation to learn more about workspace keys](https://docs.microsoft.com/azure/azure-monitor/platform/agent-windows#obtain-workspace-id-and-key).",
- "provider": "Microsoft.OperationalInsights/workspaces/sharedKeys",
- "providerDisplayName": "Keys",
- "requiredPermissions": {"action": True},
- "scope": "Workspace",
- },
- ],
- },
- "publisher": "Qualys",
- "sampleQueries": [
- {
- "description": "Top 10 Vulerabilities detected",
- "query": "{{graphQueriesTableName}}\n | mv-expand todynamic(Detections_s)\n | extend Vulnerability = tostring(Detections_s.Results)\n | summarize count() by Vulnerability\n | top 10 by count_",
- }
- ],
- "title": "Qualys Vulnerability Management (CCP DEMO)",
- }
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateGenericUI.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_nrt_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_nrt_alert_rule.py
deleted file mode 100644
index b52313895455..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_nrt_alert_rule.py
+++ /dev/null
@@ -1,68 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_nrt_alert_rule.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.alert_rules.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- alert_rule={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "NRT",
- "properties": {
- "description": "",
- "displayName": "Rule2",
- "enabled": True,
- "eventGroupingSettings": {"aggregationKind": "AlertPerResult"},
- "incidentConfiguration": {
- "createIncident": True,
- "groupingConfiguration": {
- "enabled": True,
- "groupByEntities": ["Host", "Account"],
- "lookbackDuration": "PT5H",
- "matchingMethod": "Selected",
- "reopenClosedIncident": False,
- },
- },
- "query": "ProtectionStatus | extend HostCustomEntity = Computer | extend IPCustomEntity = ComputerIP_Hidden",
- "severity": "High",
- "suppressionDuration": "PT1H",
- "suppressionEnabled": False,
- "tactics": ["Persistence", "LateralMovement"],
- "techniques": ["T1037", "T1021"],
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/CreateNrtAlertRule.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_threat_intelligence_taxii_data_connector.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_threat_intelligence_taxii_data_connector.py
deleted file mode 100644
index 1b4a4587c163..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_threat_intelligence_taxii_data_connector.py
+++ /dev/null
@@ -1,58 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python create_threat_intelligence_taxii_data_connector.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- data_connector={
- "etag": "d12423f6-a60b-4ca5-88c0-feb1a182d0f0",
- "kind": "ThreatIntelligenceTaxii",
- "properties": {
- "collectionId": "135",
- "dataTypes": {"taxiiClient": {"state": "Enabled"}},
- "friendlyName": "testTaxii",
- "password": "--",
- "pollingFrequency": "OnceADay",
- "taxiiLookbackPeriod": "2020-01-01T13:00:30.123Z",
- "taxiiServer": "https://limo.anomali.com/api/v1/taxii2/feeds",
- "tenantId": "06b3ccb8-1384-4bcc-aec7-852f6d57161b",
- "userName": "--",
- "workspaceId": "dd124572-4962-4495-9bd2-9dade12314b4",
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_api_polling.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/create_customizable_data_connector_definition.py
similarity index 58%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_api_polling.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/create_customizable_data_connector_definition.py
index ceceb21be0af..b30aad5612b6 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/create_customizable_data_connector_definition.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python create_api_polling.py
+ python create_customizable_data_connector_definition.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,48 +30,50 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.data_connectors.create_or_update(
+ response = client.data_connector_definitions.create_or_update(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- data_connector={
- "kind": "APIPolling",
+ data_connector_definition_name="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ connector_definition_input={
+ "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
+ "kind": "Customizable",
"properties": {
"connectorUiConfig": {
- "availability": {"isPreview": True, "status": 1},
- "connectivityCriteria": [{"type": "SentinelKindsV2", "value": []}],
+ "availability": {"isPreview": False, "status": 1},
+ "connectivityCriteria": [
+ {
+ "type": "IsConnectedQuery",
+ "value": [
+ "GitHubAuditLogPolling_CL \n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)"
+ ],
+ }
+ ],
"dataTypes": [
{
- "lastDataReceivedQuery": "{{graphQueriesTableName}}\n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)",
- "name": "{{graphQueriesTableName}}",
+ "lastDataReceivedQuery": "GitHubAuditLogPolling_CL \n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)",
+ "name": "GitHubAuditLogPolling_CL",
}
],
"descriptionMarkdown": "The GitHub audit log connector provides the capability to ingest GitHub logs into Azure Sentinel. By connecting GitHub audit logs into Azure Sentinel, you can view this data in workbooks, use it to create custom alerts, and improve your investigation process.",
"graphQueries": [
{
- "baseQuery": "{{graphQueriesTableName}}",
+ "baseQuery": "GitHubAuditLogPolling_CL",
"legend": "GitHub audit log events",
"metricName": "Total events received",
}
],
- "graphQueriesTableName": "GitHubAuditLogPolling_CL",
"instructionSteps": [
{
"description": "Enable GitHub audit Logs. \n Follow `this `_ to create or find your personal key",
"instructions": [
{
"parameters": {
- "enable": "true",
- "userRequestPlaceHoldersInput": [
- {
- "displayText": "Organization Name",
- "placeHolderName": "{{placeHolder1}}",
- "placeHolderValue": "",
- "requestObjectKey": "apiEndpoint",
- }
- ],
+ "clientIdLabel": "Client ID",
+ "clientSecretLabel": "Client Secret",
+ "connectButtonLabel": "Connect",
+ "disconnectButtonLabel": "Disconnect",
},
- "type": "APIKey",
+ "type": "OAuthForm",
}
],
"title": "Connect GitHub Enterprise Audit Log to Azure Sentinel",
@@ -88,39 +91,20 @@ def main():
"permissionsDisplayText": "read and write permissions are required.",
"provider": "Microsoft.OperationalInsights/workspaces",
"providerDisplayName": "Workspace",
- "requiredPermissions": {"delete": True, "read": True, "write": True},
+ "requiredPermissions": {"action": False, "delete": False, "read": False, "write": True},
"scope": "Workspace",
}
],
},
"publisher": "GitHub",
- "sampleQueries": [
- {"description": "All logs", "query": "{{graphQueriesTableName}}\n | take 10 "}
- ],
"title": "GitHub Enterprise Audit Log",
- },
- "pollingConfig": {
- "auth": {"apiKeyIdentifier": "token", "apiKeyName": "Authorization", "authType": "APIKey"},
- "paging": {"pageSizeParaName": "per_page", "pagingType": "LinkHeader"},
- "request": {
- "apiEndpoint": "https://api.github.com/organizations/{{placeHolder1}}/audit-log",
- "headers": {"Accept": "application/json", "User-Agent": "Scuba"},
- "httpMethod": "Get",
- "queryParameters": {"phrase": "created:{_QueryWindowStartTime}..{_QueryWindowEndTime}"},
- "queryTimeFormat": "yyyy-MM-ddTHH:mm:ssZ",
- "queryWindowInMin": 15,
- "rateLimitQps": 50,
- "retryCount": 2,
- "timeoutInSeconds": 60,
- },
- "response": {"eventsJsonPaths": ["$"]},
- },
+ }
},
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateAPIPolling.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectorDefinitions/CreateCustomizableDataConnectorDefinition.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_api_polling.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/delete_data_connector_definition_by_id.py
similarity index 82%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_api_polling.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/delete_data_connector_definition_by_id.py
index 49864982ae30..7466f51591ec 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/delete_data_connector_definition_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python delete_api_polling.py
+ python delete_data_connector_definition_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.data_connectors.delete(
+ client.data_connector_definitions.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ data_connector_definition_name="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/DeleteAPIPolling.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectorDefinitions/DeleteDataConnectorDefinitionById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark_relation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_customizable_data_connector_definition_by_id.py
similarity index 81%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark_relation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_customizable_data_connector_definition_by_id.py
index 940f286c435e..089590cd6599 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark_relation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_customizable_data_connector_definition_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python delete_bookmark_relation.py
+ python get_customizable_data_connector_definition_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,15 +30,14 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.bookmark_relations.delete(
+ response = client.data_connector_definitions.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- bookmark_id="2216d0e1-91e3-4902-89fd-d2df8c535096",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
+ data_connector_definition_name="763f9fa1-c2d3-4fa2-93e9-bccd4899aa12",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectorDefinitions/GetCustomizableDataConnectorDefinitionById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entities.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_data_connector_definitions.py
similarity index 86%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entities.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_data_connector_definitions.py
index 7497dda7be87..b9ef9eed63dc 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entities.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_data_connector_definitions.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_entities.py
+ python get_data_connector_definitions.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,7 +30,7 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.entities.list(
+ response = client.data_connector_definitions.list(
resource_group_name="myRg",
workspace_name="myWorkspace",
)
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetEntities.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectorDefinitions/GetDataConnectorDefinitions.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_dynamics365_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_intelligence_data_connector.py
similarity index 74%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_dynamics365_data_connetor.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_intelligence_data_connector.py
index 14c0e141de06..0be772a410df 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_dynamics365_data_connetor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_intelligence_data_connector.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python create_dynamics365_data_connetor.py
+ python create_microsoft_threat_intelligence_data_connector.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -32,19 +33,20 @@ def main():
response = client.data_connectors.create_or_update(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="c2541efb-c9a6-47fe-9501-87d1017d1512",
+ data_connector_id="c345bf40-8509-4ed2-b947-50cb773aaf04",
data_connector={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "Dynamics365",
+ "kind": "MicrosoftThreatIntelligence",
"properties": {
- "dataTypes": {"dynamics365CdsActivities": {"state": "Enabled"}},
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
+ "dataTypes": {
+ "microsoftEmergingThreatFeed": {"lookbackPeriod": "2024-11-01T00:00:00Z", "state": "Enabled"}
+ },
+ "tenantId": "06b3ccb8-1384-4bcc-aec7-852f6d57161b",
},
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/CreateMicrosoftThreatIntelligenceDataConnector.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_office_data_connetor.py
similarity index 94%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_data_connetor.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_office_data_connetor.py
index e64dbac15d70..e2e5303633af 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_data_connetor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_office_data_connetor.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -49,6 +50,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/CreateOfficeDataConnetor.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office365_project_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_premium_microsoft_defender_for_threat_intelligence_data_connector.py
similarity index 70%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office365_project_data_connetor.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_premium_microsoft_defender_for_threat_intelligence_data_connector.py
index 17400d2e0bbe..b389217721e4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office365_project_data_connetor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_premium_microsoft_defender_for_threat_intelligence_data_connector.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python create_office365_project_data_connetor.py
+ python create_premium_microsoft_defender_for_threat_intelligence_data_connector.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,25 +27,25 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="b66e5c69-e2eb-422a-81c3-002de57059f3",
)
response = client.data_connectors.create_or_update(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ data_connector_id="8c569548-a86c-4fb4-8ae4-d1e35a6146f8",
data_connector={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "Office365Project",
+ "kind": "PremiumMicrosoftDefenderForThreatIntelligence",
"properties": {
- "dataTypes": {"logs": {"state": "Enabled"}},
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
+ "dataTypes": {"connector": {"state": "Enabled"}},
+ "lookbackPeriod": "1970-01-01T00:00:00.000Z",
+ "tenantId": "e4afb3c4-813b-4e68-b6de-e5360866e798",
},
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateOffice365ProjectDataConnetor.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/CreatePremiumMicrosoftDefenderForThreatIntelligenceDataConnector.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_threat_intelligence_data_connector.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_threat_intelligence_data_connector.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_threat_intelligence_data_connector.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_threat_intelligence_data_connector.py
index e58c78df5816..d471620552ab 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_threat_intelligence_data_connector.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_threat_intelligence_data_connector.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -45,6 +46,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_generic_ui.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_threat_intelligence_data_connector.py
similarity index 82%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_generic_ui.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_threat_intelligence_data_connector.py
index b73a6e33886e..662bdba5fab9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_generic_ui.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_threat_intelligence_data_connector.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python delete_generic_ui.py
+ python delete_microsoft_threat_intelligence_data_connector.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.data_connectors.delete(
+ client.data_connectors.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ data_connector_id="c345bf40-8509-4ed2-b947-50cb773aaf04",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/DeleteGenericUI.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/DeleteMicrosoftThreatIntelligenceDataConnector.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_office_data_connetor.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_data_connetor.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_office_data_connetor.py
index ea1346bce56e..18096138f665 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_data_connetor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_office_data_connetor.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.data_connectors.delete(
+ client.data_connectors.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/DeleteOfficeDataConnetor.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office365_project_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_premium_microsoft_defender_for_threat_intelligence_data_connector.py
similarity index 77%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office365_project_data_connetor.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_premium_microsoft_defender_for_threat_intelligence_data_connector.py
index 8b565c226eb2..0500e8e73a42 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office365_project_data_connetor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_premium_microsoft_defender_for_threat_intelligence_data_connector.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python delete_office365_project_data_connetor.py
+ python delete_premium_microsoft_defender_for_threat_intelligence_data_connector.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,17 +27,16 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="b66e5c69-e2eb-422a-81c3-002de57059f3",
)
- response = client.data_connectors.delete(
+ client.data_connectors.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ data_connector_id="8c569548-a86c-4fb4-8ae4-d1e35a6146f8",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/DeleteOffice365ProjectDataConnetor.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/DeletePremiumMicrosoftDefenderForThreatIntelligenceDataConnector.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_amazon_web_services_cloud_trail_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_amazon_web_services_cloud_trail_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_amazon_web_services_cloud_trail_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_amazon_web_services_cloud_trail_by_id.py
index 763052e052f7..d0a190d24acb 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_amazon_web_services_cloud_trail_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_amazon_web_services_cloud_trail_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_active_directory_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_active_directory_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_active_directory_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_active_directory_by_id.py
index 6fce52a1fd6c..1f8f2475c680 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_active_directory_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_active_directory_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetAzureActiveDirectoryById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_advanced_threat_protection_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_advanced_threat_protection_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_advanced_threat_protection_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_advanced_threat_protection_by_id.py
index b6d603f21861..921581691230 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_advanced_threat_protection_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_advanced_threat_protection_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_security_center_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_security_center_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_security_center_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_security_center_by_id.py
index efd0ea37571e..8ed32e699c52 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_security_center_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_azure_security_center_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetAzureSecurityCenterById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_data_connectors.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_data_connectors.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_data_connectors.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_data_connectors.py
index 3427dc2447ff..1454f5e6b89c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_data_connectors.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_data_connectors.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetDataConnectors.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetDataConnectors.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_cloud_app_security_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_cloud_app_security_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_cloud_app_security_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_cloud_app_security_by_id.py
index 31c5ac11df7d..92879c30fe3c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_cloud_app_security_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_cloud_app_security_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_defender_advanced_threat_protection_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_defender_advanced_threat_protection_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_defender_advanced_threat_protection_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_defender_advanced_threat_protection_by_id.py
index b1d6154e90aa..98207c1bc31c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_defender_advanced_threat_protection_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_defender_advanced_threat_protection_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_threat_intelligence_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_threat_intelligence_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_threat_intelligence_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_threat_intelligence_by_id.py
index 404e3265f958..420c16020f47 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_threat_intelligence_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_threat_intelligence_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_data_connetor_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office_data_connetor_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_data_connetor_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office_data_connetor_by_id.py
index 0a4e4319b4f7..4e6caf1cf808 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_data_connetor_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office_data_connetor_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetOfficeDataConnetorById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_amazon_web_services_s3_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_premium_microsoft_defender_for_threat_intelligence_by_id.py
similarity index 80%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_amazon_web_services_s3_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_premium_microsoft_defender_for_threat_intelligence_by_id.py
index 6738b3b06f21..923b3e86a483 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_amazon_web_services_s3_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_premium_microsoft_defender_for_threat_intelligence_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_amazon_web_services_s3_by_id.py
+ python get_premium_microsoft_defender_for_threat_intelligence_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -26,17 +27,17 @@
def main():
client = SecurityInsights(
credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
+ subscription_id="b66e5c69-e2eb-422a-81c3-002de57059f3",
)
response = client.data_connectors.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="afef3743-0c88-469c-84ff-ca2e87dc1e48",
+ data_connector_id="8c569548-a86c-4fb4-8ae4-d1e35a6146f8",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetPremiumMicrosoftDefenderForThreatIntelligenceById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_api_polling.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_rest_api_poller_by_id.py
similarity index 86%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_api_polling.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_rest_api_poller_by_id.py
index e36510675dde..dc426b78021c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_rest_api_poller_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_api_polling.py
+ python get_rest_api_poller_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -32,11 +33,11 @@ def main():
response = client.data_connectors.get(
resource_group_name="myRg",
workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ data_connector_id="RestApiPoller_fce27b90-d6f5-4d30-991a-af509a2b50a1",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetAPIPolling.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetRestApiPollerById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_threat_protection_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_by_id.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_threat_protection_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_by_id.py
index d97c5ff04218..53d417d39e53 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_threat_protection_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_microsoft_threat_protection_by_id.py
+ python get_threat_intelligence_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/dataConnectors/GetThreatIntelligenceById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_file_import.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_file_import.py
deleted file mode 100644
index 3b966a3523f3..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_file_import.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python delete_file_import.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.file_imports.begin_delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- file_import_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/fileImports/DeleteFileImport.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_consents.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_consents.py
deleted file mode 100644
index d66ae4ac7351..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_consents.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python delete_office_consents.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.office_consents.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- consent_id="04e5fd05-ff86-4b97-b8d2-1c20933cb46c",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/officeConsents/DeleteOfficeConsents.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_power_bi_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_power_bi_data_connetor.py
deleted file mode 100644
index 9e48c8e08851..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_power_bi_data_connetor.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python delete_office_power_bi_data_connetor.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/DeleteOfficePowerBIDataConnetor.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/disconnect_api_polling.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/disconnect_api_polling.py
deleted file mode 100644
index 86acefb3218e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/disconnect_api_polling.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python disconnect_api_polling.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.disconnect(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/DisconnectAPIPolling.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_by_id.py
deleted file mode 100644
index 627d89dee6b5..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_activity_entity_query_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entity_queries.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueries/GetActivityEntityQueryById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_template_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_template_by_id.py
deleted file mode 100644
index 8535ed42977e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_template_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_activity_entity_query_template_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entity_query_templates.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_template_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_bookmark_relations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_bookmark_relations.py
deleted file mode 100644
index dd257f859112..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_bookmark_relations.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_all_bookmark_relations.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.bookmark_relations.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="2216d0e1-91e3-4902-89fd-d2df8c535096",
- )
- for item in response:
- print(item)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_entity_relations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_entity_relations.py
deleted file mode 100644
index 292751766fbf..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_entity_relations.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_all_entity_relations.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities_relations.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
- )
- for item in response:
- print(item)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/relations/GetAllEntityRelations.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_resource_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_resource_entity_by_id.py
deleted file mode 100644
index b050cca4c7c5..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_resource_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_azure_resource_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetAzureResourceEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_relation_by_name.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_relation_by_name.py
deleted file mode 100644
index 7426af196f31..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_relation_by_name.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_bookmark_relation_by_name.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.bookmark_relations.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="2216d0e1-91e3-4902-89fd-d2df8c535096",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_cloud_application_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_cloud_application_entity_by_id.py
deleted file mode 100644
index 6f0e16b2e736..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_cloud_application_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_cloud_application_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetCloudApplicationEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dns_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dns_entity_by_id.py
deleted file mode 100644
index d12e56266b46..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dns_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_dns_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="f4e74920-f2c0-4412-a45f-66d94fdf01f8",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetDnsEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dynamics365_data_connector_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dynamics365_data_connector_by_id.py
deleted file mode 100644
index 7b5578864e8a..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dynamics365_data_connector_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_dynamics365_data_connector_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c2541efb-c9a6-47fe-9501-87d1017d1512",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_query_templates.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_query_templates.py
deleted file mode 100644
index 9891a363b78b..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_query_templates.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_entity_query_templates.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entity_query_templates.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- )
- for item in response:
- print(item)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_relation_by_name.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_relation_by_name.py
deleted file mode 100644
index 9f6da60a51c1..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_relation_by_name.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_entity_relation_by_name.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entity_relations.get_relation(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/relations/GetEntityRelationByName.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_expansion_entity_query_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_expansion_entity_query_by_id.py
deleted file mode 100644
index b602cd4c4c5f..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_expansion_entity_query_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_expansion_entity_query_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entity_queries.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_entity_by_id.py
deleted file mode 100644
index 91f2d212d0ef..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_file_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="af378b21-b4aa-4fe7-bc70-13f8621a322f",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetFileEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_hash_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_hash_entity_by_id.py
deleted file mode 100644
index e3191f6d250b..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_hash_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_file_hash_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="ea359fa6-c1e5-f878-e105-6344f3e399a1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetFileHashEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_import_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_import_by_id.py
deleted file mode 100644
index 31cca3f33ca3..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_import_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_file_import_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.file_imports.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- file_import_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/fileImports/GetFileImportById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_generic_ui.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_generic_ui.py
deleted file mode 100644
index 3d93903adcd8..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_generic_ui.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_generic_ui.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetGenericUI.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_geodata_by_ip.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_geodata_by_ip.py
deleted file mode 100644
index 93496f23f2d7..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_geodata_by_ip.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_geodata_by_ip.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="bd794837-4d29-4647-9105-6339bfdb4e6a",
- )
-
- response = client.ip_geodata.get(
- resource_group_name="myRg",
- ip_address="1.2.3.4",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/enrichment/GetGeodataByIp.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_host_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_host_entity_by_id.py
deleted file mode 100644
index da73796bf50e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_host_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_host_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetHostEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tby_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tby_id.py
deleted file mode 100644
index 2862942122ce..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tby_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_io_tby_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="d2e5dc7a-f3a2-429d-954b-939fa8c2932e",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetIoTById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tdevice_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tdevice_entity_by_id.py
deleted file mode 100644
index eb492445a610..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tdevice_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_io_tdevice_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetIoTDeviceEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_ip_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_ip_entity_by_id.py
deleted file mode 100644
index 0df0f6826bed..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_ip_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_ip_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetIpEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_cluster_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_cluster_entity_by_id.py
deleted file mode 100644
index f43526065efd..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_cluster_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_mail_cluster_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetMailClusterEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_message_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_message_entity_by_id.py
deleted file mode 100644
index 5d9c55a18e9f..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_message_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_mail_message_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetMailMessageEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mailbox_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mailbox_entity_by_id.py
deleted file mode 100644
index ab443b71cfd7..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mailbox_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_mailbox_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetMailboxEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_malware_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_malware_entity_by_id.py
deleted file mode 100644
index 5c8a14d51428..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_malware_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_malware_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="af378b21-b4aa-4fe7-bc70-13f8621a322f",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetMalwareEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_insider_risk_management_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_insider_risk_management_by_id.py
deleted file mode 100644
index 51ae83893b7d..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_insider_risk_management_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_microsoft_insider_risk_management_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="3d3e955e-33eb-401d-89a7-251c81ddd660",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_nrt_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_nrt_alert_rule.py
deleted file mode 100644
index e3ffcd9605df..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_nrt_alert_rule.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_nrt_alert_rule.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.alert_rules.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/GetNrtAlertRule.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_advanced_threat_protection_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_advanced_threat_protection_by_id.py
deleted file mode 100644
index ce52eaf4847f..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_advanced_threat_protection_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_office365_advanced_threat_protection_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="3d3e955e-33eb-401d-89a7-251c81ddd660",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetOffice365AdvancedThreatProtectionById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_project_data_connetor_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_project_data_connetor_by_id.py
deleted file mode 100644
index 5486268cc6f0..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_project_data_connetor_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_office365_project_data_connetor_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetOffice365ProjectDataConnetorById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents_by_id.py
deleted file mode 100644
index 07d171e85fe9..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_office_consents_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.office_consents.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- consent_id="04e5fd05-ff86-4b97-b8d2-1c20933cb46c",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/officeConsents/GetOfficeConsentsById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_power_bi_data_connetor_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_power_bi_data_connetor_by_id.py
deleted file mode 100644
index 6136caf31c43..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_power_bi_data_connetor_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_office_power_bi_data_connetor_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetOfficePowerBIDataConnetorById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_process_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_process_entity_by_id.py
deleted file mode 100644
index f00cd0a7d744..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_process_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_process_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="7264685c-038c-42c6-948c-38e14ef1fb98",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetProcessEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_queries.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_queries.py
deleted file mode 100644
index eb816400aa67..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_queries.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_queries.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.queries(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- kind="Insight",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetQueries.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendation.py
deleted file mode 100644
index 10ce219569fc..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendation.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_recommendation.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.get.single_recommendation(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- recommendation_id="6d4b54eb-8684-4aa3-a156-3aa37b8014bc",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/recommendations/GetRecommendation.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_key_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_key_entity_by_id.py
deleted file mode 100644
index cb4e42df61ca..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_key_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_registry_key_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetRegistryKeyEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_value_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_value_entity_by_id.py
deleted file mode 100644
index 5081e924eae9..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_value_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_registry_value_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="dc44bd11-b348-4d76-ad29-37bf7aa41356",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetRegistryValueEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_alert_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_alert_entity_by_id.py
deleted file mode 100644
index d97f34e82268..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_alert_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_security_alert_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="4aa486e0-6f85-41af-99ea-7acdce7be6c8",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetSecurityAlertEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_group_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_group_entity_by_id.py
deleted file mode 100644
index 4dbc57ea7730..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_group_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_security_group_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetSecurityGroupEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_submission_mail_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_submission_mail_entity_by_id.py
deleted file mode 100644
index 3ee652535e57..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_submission_mail_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_submission_mail_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetSubmissionMailEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_taxii_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_taxii_by_id.py
deleted file mode 100644
index 52cb79c118e1..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_taxii_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_threat_intelligence_taxii_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c39bb458-02a7-4b3f-b0c8-71a1d2692652",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_url_entity_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_url_entity_by_id.py
deleted file mode 100644
index fb4d819a677e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_url_entity_by_id.py
+++ /dev/null
@@ -1,42 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_url_entity_by_id.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetUrlEntityById.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_whois_by_domain_name.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_whois_by_domain_name.py
deleted file mode 100644
index 53f54bfb1d25..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_whois_by_domain_name.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python get_whois_by_domain_name.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="bd794837-4d29-4647-9105-6339bfdb4e6a",
- )
-
- response = client.domain_whois.get(
- resource_group_name="myRg",
- domain="microsoft.com",
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/enrichment/GetWhoisByDomainName.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/create_incident_comment.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_create_or_update.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/create_incident_comment.py
index 76b762bca38f..45771d624d10 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_create_or_update.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/create_incident_comment.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incident_comments_create_or_update.py
+ python create_incident_comment.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -39,6 +40,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentComments/IncidentComments_CreateOrUpdate.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/comments/CreateIncidentComment.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_delete.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/delete_incident_comment.py
similarity index 86%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/delete_incident_comment.py
index 41de0f2f027c..7e2d3b316bd5 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/delete_incident_comment.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incident_comments_delete.py
+ python delete_incident_comment.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,15 +30,14 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.incident_comments.delete(
+ client.incident_comments.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
incident_comment_id="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentComments/IncidentComments_Delete.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/comments/DeleteIncidentComment.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_list.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/get_all_incident_comments.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/get_all_incident_comments.py
index 7fce290b89df..327bb0a49157 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/get_all_incident_comments.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incident_comments_list.py
+ python get_all_incident_comments.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -38,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentComments/IncidentComments_List.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/comments/GetAllIncidentComments.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/get_incident_comment_by_id.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/get_incident_comment_by_id.py
index 376e884be9ca..2dc8e7f0940d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/comments/get_incident_comment_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incident_comments_get.py
+ python get_incident_comment_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -38,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentComments/IncidentComments_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/comments/GetIncidentCommentById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/create_incident.py
similarity index 80%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_or_update.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/create_incident.py
index 99dd33a78950..531faae1a0df 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_or_update.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/create_incident.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_create_or_update.py
+ python create_incident.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -38,17 +39,11 @@ def main():
"properties": {
"classification": "FalsePositive",
"classificationComment": "Not a malicious activity",
- "classificationReason": "InaccurateData",
+ "classificationReason": "IncorrectAlertLogic",
"description": "This is a demo incident",
"firstActivityTimeUtc": "2019-01-01T13:00:30Z",
"lastActivityTimeUtc": "2019-01-01T13:05:30Z",
- "owner": {
- "assignedTo": None,
- "email": None,
- "objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70",
- "ownerType": None,
- "userPrincipalName": None,
- },
+ "owner": {"objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70"},
"severity": "High",
"status": "Closed",
"title": "My incident",
@@ -58,6 +53,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/Incidents_CreateOrUpdate.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/CreateIncident.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_delete.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/delete_incident.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/delete_incident.py
index 46d6ef624106..33bb34aa9e22 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/delete_incident.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_delete.py
+ python delete_incident.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.incidents.delete(
+ client.incidents.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/Incidents_Delete.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/DeleteIncident.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_alerts.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_alerts.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_alerts.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_alerts.py
index a62de178a146..2cc8f9eb6e5b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_alerts.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_alerts.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_list_alerts.py
+ python get_all_incident_alerts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -32,11 +33,11 @@ def main():
response = client.incidents.list_alerts(
resource_group_name="myRg",
workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
+ incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentAlerts/Incidents_ListAlerts.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/GetAllIncidentAlerts.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_bookmarks.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_bookmarks.py
similarity index 86%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_bookmarks.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_bookmarks.py
index b931f0ff5499..a6cba0c1cb6c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_bookmarks.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_bookmarks.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_list_bookmarks.py
+ python get_all_incident_bookmarks.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -32,11 +33,11 @@ def main():
response = client.incidents.list_bookmarks(
resource_group_name="myRg",
workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
+ incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentBookmarks/Incidents_ListBookmarks.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/GetAllIncidentBookmarks.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_entities.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_entities.py
similarity index 86%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_entities.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_entities.py
index 93dbebcc10c5..b67338e5d5a1 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_entities.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_all_incident_entities.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_list_entities.py
+ python get_all_incident_entities.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -32,11 +33,11 @@ def main():
response = client.incidents.list_entities(
resource_group_name="myRg",
workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
+ incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentEntities/Incidents_ListEntities.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/GetAllIncidentEntities.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_incident_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_incident_by_id.py
index 159a603b2460..0a860235473a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_incident_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_get.py
+ python get_incident_by_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/Incidents_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/GetIncidentById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_incidents.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_incidents.py
index 92ad2ea10b6b..ee6f6fde43da 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/get_incidents.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python incidents_list.py
+ python get_incidents.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/Incidents_List.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/GetIncidents.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_incident_relation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/create_incident_relation.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_incident_relation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/create_incident_relation.py
index 18684885840e..8657f75e7aea 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_incident_relation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/create_incident_relation.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -36,13 +37,13 @@ def main():
relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
relation={
"properties": {
- "relatedResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"
+ "relatedResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"
}
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/relations/CreateIncidentRelation.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/relations/CreateIncidentRelation.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_incident_relation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/delete_incident_relation.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_incident_relation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/delete_incident_relation.py
index 78337555b97a..08d0bf753731 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_incident_relation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/delete_incident_relation.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,15 +30,14 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.incident_relations.delete(
+ client.incident_relations.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/relations/DeleteIncidentRelation.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/relations/DeleteIncidentRelation.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_incident_relations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/get_all_incident_relations.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_incident_relations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/get_all_incident_relations.py
index d51befaed744..39d8ad114744 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_incident_relations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/get_all_incident_relations.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/relations/GetAllIncidentRelations.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/relations/GetAllIncidentRelations.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_incident_relation_by_name.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/get_incident_relation_by_name.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_incident_relation_by_name.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/get_incident_relation_by_name.py
index 56607932ef56..48f793ac5c28 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_incident_relation_by_name.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/relations/get_incident_relation_by_name.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/relations/GetIncidentRelationByName.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/relations/GetIncidentRelationByName.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_create_or_update.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_create_or_update.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_create_or_update.py
index 358cd15f754e..0432afdde8a4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_create_or_update.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_create_or_update.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -39,6 +40,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentTasks/IncidentTasks_CreateOrUpdate.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/tasks/IncidentTasks_CreateOrUpdate.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_delete.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_delete.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_delete.py
index 4e742bfbd432..d244346ab3c8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_delete.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,15 +30,14 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.incident_tasks.delete(
+ client.incident_tasks.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
incident_task_id="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentTasks/IncidentTasks_Delete.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/tasks/IncidentTasks_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_get.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_get.py
index e825d109fd60..bdd6aa0edcd9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_get.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentTasks/IncidentTasks_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/tasks/IncidentTasks_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_list.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_list.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_list.py
index 371a20ddd697..683d12f2093f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/tasks/incident_tasks_list.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/IncidentTasks/IncidentTasks_List.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/incidents/tasks/IncidentTasks_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_settings.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/entities_run_playbook.py
similarity index 85%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_settings.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/entities_run_playbook.py
index 9686f64f3e57..78d0e20b4e58 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_settings.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/entities_run_playbook.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -14,7 +15,7 @@
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_all_settings.py
+ python entities_run_playbook.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
@@ -29,13 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.product_settings.list(
+ client.entities.run_playbook(
resource_group_name="myRg",
workspace_name="myWorkspace",
+ entity_identifier="72e01a22-5cd2-4139-a149-9f2736ff2ar2",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/settings/GetAllSettings.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/manualTrigger/Entities_RunPlaybook.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_run_playbook.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/incidents_run_playbook.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_run_playbook.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/incidents_run_playbook.py
index eeccd2e1694d..48acd92a96a0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_run_playbook.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/incidents_run_playbook.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.incidents.run_playbook(
+ client.incidents.run_playbook(
resource_group_name="myRg",
workspace_name="myWorkspace",
incident_identifier="73e01a99-5cd7-4139-a149-9f2736ff2ar4",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/manualTrigger/Incidents_RunPlaybook.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/manualTrigger/Incidents_RunPlaybook.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_metadata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/delete_metadata.py
similarity index 90%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_metadata.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/delete_metadata.py
index 49bd06ba9428..07dbeec36295 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_metadata.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/delete_metadata.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.metadata.delete(
+ client.metadata.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
metadata_name="metadataName",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/DeleteMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/DeleteMetadata.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_metadata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_all_metadata.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_metadata.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_all_metadata.py
index 7db4cc0f8c28..f9e7debd87e6 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_metadata.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_all_metadata.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/GetAllMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/GetAllMetadata.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_metadata_odata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_all_metadata_odata.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_metadata_odata.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_all_metadata_odata.py
index 5b4257bac619..4834fb79fd01 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_metadata_odata.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_all_metadata_odata.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/GetAllMetadataOData.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/GetAllMetadataOData.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_metadata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_metadata.py
similarity index 94%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_metadata.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_metadata.py
index e8d786700ebb..816437e163f9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_metadata.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/get_metadata.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/GetMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/GetMetadata.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_metadata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/patch_metadata.py
similarity index 94%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_metadata.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/patch_metadata.py
index 7cbdf1b8fb56..19d4d9de2c19 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_metadata.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/patch_metadata.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/PatchMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/PatchMetadata.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata.py
similarity index 97%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata.py
index 62ff77bced8a..988f1455389c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -90,6 +91,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/PutMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/PutMetadata.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata_minimal.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata_minimal.py
similarity index 94%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata_minimal.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata_minimal.py
index 10215a694f1a..6614a3ed6098 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata_minimal.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata_minimal.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -44,6 +45,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/PutMetadataMinimal.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/metadata/PutMetadataMinimal.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_sentinel_onboarding_state.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/create_sentinel_onboarding_state.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_sentinel_onboarding_state.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/create_sentinel_onboarding_state.py
index 5c8fe53f325f..e4327d89bc95 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_sentinel_onboarding_state.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/create_sentinel_onboarding_state.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/onboardingStates/CreateSentinelOnboardingState.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_sentinel_onboarding_state.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/delete_sentinel_onboarding_state.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_sentinel_onboarding_state.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/delete_sentinel_onboarding_state.py
index 7efd7e514297..3e9c87cf4804 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_sentinel_onboarding_state.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/delete_sentinel_onboarding_state.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.sentinel_onboarding_states.delete(
+ client.sentinel_onboarding_states.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
sentinel_onboarding_state_name="default",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/onboardingStates/DeleteSentinelOnboardingState.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_sentinel_onboarding_states.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/get_all_sentinel_onboarding_states.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_sentinel_onboarding_states.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/get_all_sentinel_onboarding_states.py
index 50414b351665..e4dfaf41d127 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_sentinel_onboarding_states.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/get_all_sentinel_onboarding_states.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -36,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/onboardingStates/GetAllSentinelOnboardingStates.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_sentinel_onboarding_state.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/get_sentinel_onboarding_state.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_sentinel_onboarding_state.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/get_sentinel_onboarding_state.py
index 9913163dbb50..ae874be6c4a0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_sentinel_onboarding_state.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/onboarding_states/get_sentinel_onboarding_state.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/onboardingStates/GetSentinelOnboardingState.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/list_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/operations/list_operations.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/list_operations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/operations/list_operations.py
index c5bdf9face9c..bba80a0eeb51 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/list_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/operations/list_operations.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -34,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/operations/ListOperations.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/operations/ListOperations.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_recommendation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_recommendation.py
deleted file mode 100644
index 42ed7cf1e6ac..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_recommendation.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python patch_recommendation.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.update.begin_recommendation(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- recommendation_id="6d4b54eb-8684-4aa3-a156-3aa37b8014bc",
- recommendation_patch=[{"state": "Active"}],
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/recommendations/PatchRecommendation.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_bookmark.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_bookmark.py
deleted file mode 100644
index 49329bae179a..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_bookmark.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python post_expand_bookmark.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.bookmark.expand(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- parameters={
- "endTime": "2020-01-24T17:21:00.000Z",
- "expansionId": "27f76e63-c41b-480f-bb18-12ad2e011d49",
- "startTime": "2019-12-25T17:21:00.000Z",
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/expand/PostExpandBookmark.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_entity.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_entity.py
deleted file mode 100644
index 6419a34d794d..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_entity.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python post_expand_entity.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.expand(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- parameters={
- "endTime": "2019-05-26T00:00:00.000Z",
- "expansionId": "a77992f3-25e9-4d01-99a4-5ff606cc410a",
- "startTime": "2019-04-25T00:00:00.000Z",
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/expand/PostExpandEntity.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_get_insights.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_get_insights.py
deleted file mode 100644
index 4e210c82efb3..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_get_insights.py
+++ /dev/null
@@ -1,48 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python post_get_insights.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities.get_insights(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- parameters={
- "addDefaultExtendedTimeRange": False,
- "endTime": "2021-10-01T00:00:00.000Z",
- "insightQueryIds": ["cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4"],
- "startTime": "2021-09-01T00:00:00.000Z",
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/insights/PostGetInsights.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_timeline_entity.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_timeline_entity.py
deleted file mode 100644
index 8d224b26250a..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_timeline_entity.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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python post_timeline_entity.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.entities_get_timeline.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- parameters={
- "endTime": "2021-10-01T00:00:00.000Z",
- "numberOfBucket": 4,
- "startTime": "2021-09-01T00:00:00.000Z",
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/timeline/PostTimelineEntity.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_repositories.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/repositories/get_repositories.py
similarity index 75%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_repositories.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/repositories/get_repositories.py
index a79ba4b95ce1..8545e9554aea 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_repositories.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/repositories/get_repositories.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -32,12 +33,22 @@ def main():
response = client.source_control.list_repositories(
resource_group_name="myRg",
workspace_name="myWorkspace",
- repo_type="Github",
+ repository_access={
+ "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
+ "properties": {
+ "repositoryAccess": {
+ "clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73",
+ "code": "939fd7c6caf754f4f41f",
+ "kind": "OAuth",
+ "state": "state",
+ }
+ },
+ },
)
for item in response:
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/repositories/GetRepositories.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/repositories/GetRepositories.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_security_ml_analytics_setting.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/delete_security_ml_analytics_setting.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_security_ml_analytics_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/delete_security_ml_analytics_setting.py
index 10c84d42cbb3..6dacebea9e46 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_security_ml_analytics_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/delete_security_ml_analytics_setting.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.security_ml_analytics_settings.delete(
+ client.security_ml_analytics_settings.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
settings_resource_name="f209187f-1d17-4431-94af-c141bf5f23db",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_security_ml_analytics_settings.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/get_all_security_ml_analytics_settings.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_security_ml_analytics_settings.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/get_all_security_ml_analytics_settings.py
index 1a674b133d69..889ad46faa62 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_security_ml_analytics_settings.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/get_all_security_ml_analytics_settings.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_anomaly_security_ml_analytics_setting.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/get_anomaly_security_ml_analytics_setting.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_anomaly_security_ml_analytics_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/get_anomaly_security_ml_analytics_setting.py
index 58c9a9583e24..2d8f66ca718f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_anomaly_security_ml_analytics_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/security_ml_analytics_settings/get_anomaly_security_ml_analytics_setting.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_source_control.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/create_source_control.py
similarity index 85%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_source_control.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/create_source_control.py
index e4ba898e9ea7..a439ca7bf947 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_source_control.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/create_source_control.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -43,18 +44,20 @@ def main():
"repository": {
"branch": "master",
"displayUrl": "https://github.com/user/repo",
- "pathMapping": [
- {"contentType": "AnalyticRules", "path": "path/to/rules"},
- {"contentType": "Workbook", "path": "path/to/workbooks"},
- ],
"url": "https://github.com/user/repo",
},
+ "repositoryAccess": {
+ "clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73",
+ "code": "939fd7c6caf754f4f41f",
+ "kind": "OAuth",
+ "state": "state",
+ },
},
},
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/sourcecontrols/CreateSourceControl.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/sourcecontrols/CreateSourceControl.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_source_control.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/delete_source_control.py
similarity index 78%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_source_control.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/delete_source_control.py
index b39bed43c896..2ea2b7d214f9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_source_control.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/delete_source_control.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -33,10 +34,20 @@ def main():
resource_group_name="myRg",
workspace_name="myWorkspace",
source_control_id="789e0c1f-4a3d-43ad-809c-e713b677b04a",
+ repository_access={
+ "properties": {
+ "repositoryAccess": {
+ "clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73",
+ "code": "939fd7c6caf754f4f41f",
+ "kind": "OAuth",
+ "state": "state",
+ }
+ }
+ },
)
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/sourcecontrols/DeleteSourceControl.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/sourcecontrols/DeleteSourceControl.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_source_control_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/get_source_control_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_source_control_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/get_source_control_by_id.py
index 340237ce6a45..74d97368111d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_source_control_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/get_source_control_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/sourcecontrols/GetSourceControlById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/sourcecontrols/GetSourceControlById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_source_controls.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/get_source_controls.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_source_controls.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/get_source_controls.py
index ceb9628d252b..2f690de73c6f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_source_controls.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/get_source_controls.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/sourcecontrols/GetSourceControls.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/sourcecontrols/GetSourceControls.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/collect_threat_intelligence_metrics.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/collect_threat_intelligence_metrics.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/collect_threat_intelligence_metrics.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/collect_threat_intelligence_metrics.py
index a75c2fbfdef1..f15d129a86e4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/collect_threat_intelligence_metrics.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/collect_threat_intelligence_metrics.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -36,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/threatintelligence/CollectThreatIntelligenceMetrics.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_threat_intelligence.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/delete_threat_intelligence.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_threat_intelligence.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/delete_threat_intelligence.py
index 254248e2572d..4a814a92a17d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_threat_intelligence.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/delete_threat_intelligence.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="bd794837-4d29-4647-9105-6339bfdb4e6a",
)
- response = client.threat_intelligence_indicator.delete(
+ client.threat_intelligence_indicator.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
name="d9cd6f0b-96b9-3984-17cd-a779d1e15a93",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/threatintelligence/DeleteThreatIntelligence.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/get_threat_intelligence.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/get_threat_intelligence.py
index 6dc9762759ac..6b863848d79f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/get_threat_intelligence.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/threatintelligence/GetThreatIntelligence.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/threatintelligence/GetThreatIntelligence.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/get_threat_intelligence_by_id.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/get_threat_intelligence_by_id.py
index 41e6c872c5ee..2a929d4de205 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/get_threat_intelligence_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/threatintelligence/GetThreatIntelligenceById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/update_eyes_on_setting.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/update_eyes_on_setting.py
deleted file mode 100644
index 9f10f20bb113..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/update_eyes_on_setting.py
+++ /dev/null
@@ -1,43 +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 azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-securityinsight
-# USAGE
- python update_eyes_on_setting.py
-
- Before run the sample, please set the values of the client ID, tenant ID and client secret
- of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
- AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
- https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
-"""
-
-
-def main():
- client = SecurityInsights(
- credential=DefaultAzureCredential(),
- subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
- )
-
- response = client.product_settings.update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- settings_name="EyesOn",
- settings={"etag": '"0300bf09-0000-0000-0000-5c37296e0000"', "kind": "EyesOn", "properties": {}},
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/settings/UpdateEyesOnSetting.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist.py
index 47b0e922392f..68443c4e414e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,7 +30,7 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.watchlists.create_or_update(
+ response = client.watchlists.begin_create_or_update(
resource_group_name="myRg",
workspace_name="myWorkspace",
watchlist_alias="highValueAsset",
@@ -44,10 +45,10 @@ def main():
"sourceType": "Local file",
},
},
- )
+ ).result()
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/CreateWatchlist.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/CreateWatchlist.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_and_watchlist_items.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_and_watchlist_items.py
similarity index 92%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_and_watchlist_items.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_and_watchlist_items.py
index 96205b46222e..3c58cda8fdc1 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_and_watchlist_items.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_and_watchlist_items.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,7 +30,7 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.watchlists.create_or_update(
+ response = client.watchlists.begin_create_or_update(
resource_group_name="myRg",
workspace_name="myWorkspace",
watchlist_alias="highValueAsset",
@@ -47,10 +48,10 @@ def main():
"sourceType": "Local file",
},
},
- )
+ ).result()
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/CreateWatchlistAndWatchlistItems.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_item.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_item.py
similarity index 95%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_item.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_item.py
index f527c1dbf8eb..9e01b6ee519c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_item.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_item.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -51,6 +52,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/CreateWatchlistItem.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/CreateWatchlistItem.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_watchlist.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/delete_watchlist.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_watchlist.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/delete_watchlist.py
index 657798684a34..4f29a283d90d 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_watchlist.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/delete_watchlist.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,14 +30,13 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.watchlists.delete(
+ client.watchlists.begin_delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
watchlist_alias="highValueAsset",
- )
- print(response)
+ ).result()
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/DeleteWatchlist.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/DeleteWatchlist.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_watchlist_item.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/delete_watchlist_item.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_watchlist_item.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/delete_watchlist_item.py
index d22cdfb7f9df..aef9a6df9037 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_watchlist_item.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/delete_watchlist_item.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -29,15 +30,14 @@ def main():
subscription_id="d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
)
- response = client.watchlist_items.delete(
+ client.watchlist_items.delete(
resource_group_name="myRg",
workspace_name="myWorkspace",
watchlist_alias="highValueAsset",
watchlist_item_id="4008512e-1d30-48b2-9ee2-d3612ed9d3ea",
)
- print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/DeleteWatchlistItem.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/DeleteWatchlistItem.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_by_alias.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_by_alias.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_by_alias.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_by_alias.py
index 52d3b745e293..5b8f940f2fd1 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_by_alias.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_by_alias.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/GetWatchlistByAlias.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/GetWatchlistByAlias.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_item_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_item_by_id.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_item_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_item_by_id.py
index 412ba40fef43..4eec8151dadb 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_item_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_item_by_id.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/GetWatchlistItemById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/GetWatchlistItemById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_items.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_items.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_items.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_items.py
index ca7c80699b5b..caa3bb04f72e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlist_items.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlist_items.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -38,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/GetWatchlistItems.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/GetWatchlistItems.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlists.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlists.py
similarity index 93%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlists.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlists.py
index 2546e29b6ff9..67344b0b48ba 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_watchlists.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/get_watchlists.py
@@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
+
from azure.mgmt.securityinsight import SecurityInsights
"""
@@ -37,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/GetWatchlists.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2025-03-01/examples/watchlists/GetWatchlists.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/conftest.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/conftest.py
new file mode 100644
index 000000000000..09712332d368
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/conftest.py
@@ -0,0 +1,35 @@
+# 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 os
+import pytest
+from dotenv import load_dotenv
+from devtools_testutils import (
+ test_proxy,
+ add_general_regex_sanitizer,
+ add_body_key_sanitizer,
+ add_header_regex_sanitizer,
+)
+
+load_dotenv()
+
+
+# For security, please avoid record sensitive identity information in recordings
+@pytest.fixture(scope="session", autouse=True)
+def add_sanitizers(test_proxy):
+ securityinsights_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
+ securityinsights_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
+ securityinsights_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
+ securityinsights_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
+ add_general_regex_sanitizer(regex=securityinsights_subscription_id, value="00000000-0000-0000-0000-000000000000")
+ add_general_regex_sanitizer(regex=securityinsights_tenant_id, value="00000000-0000-0000-0000-000000000000")
+ add_general_regex_sanitizer(regex=securityinsights_client_id, value="00000000-0000-0000-0000-000000000000")
+ add_general_regex_sanitizer(regex=securityinsights_client_secret, value="00000000-0000-0000-0000-000000000000")
+
+ add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
+ add_header_regex_sanitizer(key="Cookie", value="cookie;")
+ add_body_key_sanitizer(json_path="$..access_token", value="access_token")
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations.py
new file mode 100644
index 000000000000..434cd7a3a7c5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations.py
@@ -0,0 +1,90 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsActionsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_actions_list_by_alert_rule(self, resource_group):
+ response = self.client.actions.list_by_alert_rule(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_actions_get(self, resource_group):
+ response = self.client.actions.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ action_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_actions_create_or_update(self, resource_group):
+ response = self.client.actions.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ action_id="str",
+ action={
+ "etag": "str",
+ "id": "str",
+ "logicAppResourceId": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "triggerUri": "str",
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_actions_delete(self, resource_group):
+ response = self.client.actions.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ action_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations_async.py
new file mode 100644
index 000000000000..cc47a46c61f8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations_async.py
@@ -0,0 +1,91 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsActionsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_actions_list_by_alert_rule(self, resource_group):
+ response = self.client.actions.list_by_alert_rule(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_actions_get(self, resource_group):
+ response = await self.client.actions.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ action_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_actions_create_or_update(self, resource_group):
+ response = await self.client.actions.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ action_id="str",
+ action={
+ "etag": "str",
+ "id": "str",
+ "logicAppResourceId": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "triggerUri": "str",
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_actions_delete(self, resource_group):
+ response = await self.client.actions.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ action_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations.py
new file mode 100644
index 000000000000..edea629ad6ee
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations.py
@@ -0,0 +1,44 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsAlertRuleTemplatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_alert_rule_templates_list(self, resource_group):
+ response = self.client.alert_rule_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_alert_rule_templates_get(self, resource_group):
+ response = self.client.alert_rule_templates.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ alert_rule_template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations_async.py
new file mode 100644
index 000000000000..429e8b6750fa
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations_async.py
@@ -0,0 +1,45 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsAlertRuleTemplatesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_alert_rule_templates_list(self, resource_group):
+ response = self.client.alert_rule_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_alert_rule_templates_get(self, resource_group):
+ response = await self.client.alert_rule_templates.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ alert_rule_template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations.py
new file mode 100644
index 000000000000..7d8a6a2b03e1
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations.py
@@ -0,0 +1,93 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsAlertRulesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_alert_rules_list(self, resource_group):
+ response = self.client.alert_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_alert_rules_get(self, resource_group):
+ response = self.client.alert_rules.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_alert_rules_create_or_update(self, resource_group):
+ response = self.client.alert_rules.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ alert_rule={
+ "kind": "Fusion",
+ "alertRuleTemplateName": "str",
+ "description": "str",
+ "displayName": "str",
+ "enabled": bool,
+ "etag": "str",
+ "id": "str",
+ "lastModifiedUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "severity": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tactics": ["str"],
+ "techniques": ["str"],
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_alert_rules_delete(self, resource_group):
+ response = self.client.alert_rules.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations_async.py
new file mode 100644
index 000000000000..b8f8dcd5abe7
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations_async.py
@@ -0,0 +1,94 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsAlertRulesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_alert_rules_list(self, resource_group):
+ response = self.client.alert_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_alert_rules_get(self, resource_group):
+ response = await self.client.alert_rules.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_alert_rules_create_or_update(self, resource_group):
+ response = await self.client.alert_rules.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ alert_rule={
+ "kind": "Fusion",
+ "alertRuleTemplateName": "str",
+ "description": "str",
+ "displayName": "str",
+ "enabled": bool,
+ "etag": "str",
+ "id": "str",
+ "lastModifiedUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "severity": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tactics": ["str"],
+ "techniques": ["str"],
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_alert_rules_delete(self, resource_group):
+ response = await self.client.alert_rules.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations.py
new file mode 100644
index 000000000000..dca3b37a2249
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations.py
@@ -0,0 +1,70 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsAutomationRulesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_automation_rules_get(self, resource_group):
+ response = self.client.automation_rules.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ automation_rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_automation_rules_create_or_update(self, resource_group):
+ response = self.client.automation_rules.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ automation_rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_automation_rules_delete(self, resource_group):
+ response = self.client.automation_rules.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ automation_rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_automation_rules_list(self, resource_group):
+ response = self.client.automation_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations_async.py
new file mode 100644
index 000000000000..2bbc596a128a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations_async.py
@@ -0,0 +1,71 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsAutomationRulesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_automation_rules_get(self, resource_group):
+ response = await self.client.automation_rules.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ automation_rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_automation_rules_create_or_update(self, resource_group):
+ response = await self.client.automation_rules.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ automation_rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_automation_rules_delete(self, resource_group):
+ response = await self.client.automation_rules.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ automation_rule_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_automation_rules_list(self, resource_group):
+ response = self.client.automation_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations.py
new file mode 100644
index 000000000000..d4ae9a466266
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations.py
@@ -0,0 +1,97 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsBookmarksOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_bookmarks_list(self, resource_group):
+ response = self.client.bookmarks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_bookmarks_get(self, resource_group):
+ response = self.client.bookmarks.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ bookmark_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_bookmarks_create_or_update(self, resource_group):
+ response = self.client.bookmarks.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ bookmark_id="str",
+ bookmark={
+ "created": "2020-02-20 00:00:00",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str"},
+ "displayName": "str",
+ "etag": "str",
+ "eventTime": "2020-02-20 00:00:00",
+ "id": "str",
+ "incidentInfo": {"incidentId": "str", "relationName": "str", "severity": "str", "title": "str"},
+ "labels": ["str"],
+ "name": "str",
+ "notes": "str",
+ "query": "str",
+ "queryEndTime": "2020-02-20 00:00:00",
+ "queryResult": "str",
+ "queryStartTime": "2020-02-20 00:00:00",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {"email": "str", "name": "str", "objectId": "str"},
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_bookmarks_delete(self, resource_group):
+ response = self.client.bookmarks.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ bookmark_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations_async.py
new file mode 100644
index 000000000000..4f9954774be5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations_async.py
@@ -0,0 +1,98 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsBookmarksOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_bookmarks_list(self, resource_group):
+ response = self.client.bookmarks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_bookmarks_get(self, resource_group):
+ response = await self.client.bookmarks.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ bookmark_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_bookmarks_create_or_update(self, resource_group):
+ response = await self.client.bookmarks.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ bookmark_id="str",
+ bookmark={
+ "created": "2020-02-20 00:00:00",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str"},
+ "displayName": "str",
+ "etag": "str",
+ "eventTime": "2020-02-20 00:00:00",
+ "id": "str",
+ "incidentInfo": {"incidentId": "str", "relationName": "str", "severity": "str", "title": "str"},
+ "labels": ["str"],
+ "name": "str",
+ "notes": "str",
+ "query": "str",
+ "queryEndTime": "2020-02-20 00:00:00",
+ "queryResult": "str",
+ "queryStartTime": "2020-02-20 00:00:00",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {"email": "str", "name": "str", "objectId": "str"},
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_bookmarks_delete(self, resource_group):
+ response = await self.client.bookmarks.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ bookmark_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations.py
new file mode 100644
index 000000000000..666965e275ba
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations.py
@@ -0,0 +1,89 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentPackageOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_package_install(self, resource_group):
+ response = self.client.content_package.install(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ package_installation_properties={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentKind": "str",
+ "contentProductId": "str",
+ "contentSchemaVersion": "str",
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "id": "str",
+ "isDeprecated": "str",
+ "isFeatured": "str",
+ "isNew": "str",
+ "isPreview": "str",
+ "lastPublishDate": "2020-02-20",
+ "name": "str",
+ "providers": ["str"],
+ "publisherDisplayName": "str",
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_package_uninstall(self, resource_group):
+ response = self.client.content_package.uninstall(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations_async.py
new file mode 100644
index 000000000000..012bed4c01b6
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations_async.py
@@ -0,0 +1,90 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentPackageOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_package_install(self, resource_group):
+ response = await self.client.content_package.install(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ package_installation_properties={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentKind": "str",
+ "contentProductId": "str",
+ "contentSchemaVersion": "str",
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "id": "str",
+ "isDeprecated": "str",
+ "isFeatured": "str",
+ "isNew": "str",
+ "isPreview": "str",
+ "lastPublishDate": "2020-02-20",
+ "name": "str",
+ "providers": ["str"],
+ "publisherDisplayName": "str",
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_package_uninstall(self, resource_group):
+ response = await self.client.content_package.uninstall(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations.py
new file mode 100644
index 000000000000..9a489f718ae0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations.py
@@ -0,0 +1,44 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentPackagesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_packages_list(self, resource_group):
+ response = self.client.content_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_packages_get(self, resource_group):
+ response = self.client.content_packages.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations_async.py
new file mode 100644
index 000000000000..c70237f558d3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations_async.py
@@ -0,0 +1,45 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentPackagesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_packages_list(self, resource_group):
+ response = self.client.content_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_packages_get(self, resource_group):
+ response = await self.client.content_packages.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations.py
new file mode 100644
index 000000000000..30dda14745fa
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations.py
@@ -0,0 +1,143 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentTemplateOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_template_install(self, resource_group):
+ response = self.client.content_template.install(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ template_installation_properties={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentKind": "str",
+ "contentProductId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependantTemplates": [
+ {
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentKind": "str",
+ "contentProductId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependantTemplates": [...],
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "displayName": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "isDeprecated": "str",
+ "lastPublishDate": "2020-02-20",
+ "mainTemplate": {},
+ "packageId": "str",
+ "packageKind": "str",
+ "packageName": "str",
+ "packageVersion": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "version": "str",
+ }
+ ],
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "displayName": "str",
+ "etag": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "id": "str",
+ "isDeprecated": "str",
+ "lastPublishDate": "2020-02-20",
+ "mainTemplate": {},
+ "name": "str",
+ "packageId": "str",
+ "packageKind": "str",
+ "packageName": "str",
+ "packageVersion": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_template_get(self, resource_group):
+ response = self.client.content_template.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_template_delete(self, resource_group):
+ response = self.client.content_template.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations_async.py
new file mode 100644
index 000000000000..0641ded801d9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations_async.py
@@ -0,0 +1,144 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentTemplateOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_template_install(self, resource_group):
+ response = await self.client.content_template.install(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ template_installation_properties={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentKind": "str",
+ "contentProductId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependantTemplates": [
+ {
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentKind": "str",
+ "contentProductId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependantTemplates": [...],
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "displayName": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "isDeprecated": "str",
+ "lastPublishDate": "2020-02-20",
+ "mainTemplate": {},
+ "packageId": "str",
+ "packageKind": "str",
+ "packageName": "str",
+ "packageVersion": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "version": "str",
+ }
+ ],
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "displayName": "str",
+ "etag": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "id": "str",
+ "isDeprecated": "str",
+ "lastPublishDate": "2020-02-20",
+ "mainTemplate": {},
+ "name": "str",
+ "packageId": "str",
+ "packageKind": "str",
+ "packageName": "str",
+ "packageVersion": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_template_get(self, resource_group):
+ response = await self.client.content_template.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_template_delete(self, resource_group):
+ response = await self.client.content_template.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_operations.py
new file mode 100644
index 000000000000..c850a2284279
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentTemplatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_content_templates_list(self, resource_group):
+ response = self.client.content_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_operations_async.py
new file mode 100644
index 000000000000..c491a459619c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_operations_async.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsContentTemplatesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_content_templates_list(self, resource_group):
+ response = self.client.content_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations.py
new file mode 100644
index 000000000000..883bf87441a6
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations.py
@@ -0,0 +1,122 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsDataConnectorDefinitionsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connector_definitions_list(self, resource_group):
+ response = self.client.data_connector_definitions.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connector_definitions_get(self, resource_group):
+ response = self.client.data_connector_definitions.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_definition_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connector_definitions_create_or_update(self, resource_group):
+ response = self.client.data_connector_definitions.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_definition_name="str",
+ connector_definition_input={
+ "kind": "Customizable",
+ "connectionsConfig": {"templateSpecName": "str", "templateSpecVersion": "str"},
+ "connectorUiConfig": {
+ "connectivityCriteria": [{"type": "str", "value": ["str"]}],
+ "dataTypes": [{"lastDataReceivedQuery": "str", "name": "str"}],
+ "descriptionMarkdown": "str",
+ "graphQueries": [{"baseQuery": "str", "legend": "str", "metricName": "str"}],
+ "instructionSteps": [
+ {
+ "description": "str",
+ "innerSteps": [...],
+ "instructions": [{"parameters": {}, "type": "str"}],
+ "title": "str",
+ }
+ ],
+ "permissions": {
+ "customs": [{"description": "str", "name": "str"}],
+ "licenses": ["str"],
+ "resourceProvider": [
+ {
+ "permissionsDisplayText": "str",
+ "provider": "str",
+ "providerDisplayName": "str",
+ "requiredPermissions": {"action": bool, "delete": bool, "read": bool, "write": bool},
+ "scope": "str",
+ }
+ ],
+ "tenant": ["str"],
+ },
+ "publisher": "str",
+ "title": "str",
+ "availability": {"isPreview": bool, "status": 0},
+ "id": "str",
+ "isConnectivityCriteriasMatchSome": bool,
+ "logo": "str",
+ },
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "etag": "str",
+ "id": "str",
+ "lastModifiedUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connector_definitions_delete(self, resource_group):
+ response = self.client.data_connector_definitions.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_definition_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations_async.py
new file mode 100644
index 000000000000..b7e4fb5f760e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations_async.py
@@ -0,0 +1,123 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsDataConnectorDefinitionsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connector_definitions_list(self, resource_group):
+ response = self.client.data_connector_definitions.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connector_definitions_get(self, resource_group):
+ response = await self.client.data_connector_definitions.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_definition_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connector_definitions_create_or_update(self, resource_group):
+ response = await self.client.data_connector_definitions.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_definition_name="str",
+ connector_definition_input={
+ "kind": "Customizable",
+ "connectionsConfig": {"templateSpecName": "str", "templateSpecVersion": "str"},
+ "connectorUiConfig": {
+ "connectivityCriteria": [{"type": "str", "value": ["str"]}],
+ "dataTypes": [{"lastDataReceivedQuery": "str", "name": "str"}],
+ "descriptionMarkdown": "str",
+ "graphQueries": [{"baseQuery": "str", "legend": "str", "metricName": "str"}],
+ "instructionSteps": [
+ {
+ "description": "str",
+ "innerSteps": [...],
+ "instructions": [{"parameters": {}, "type": "str"}],
+ "title": "str",
+ }
+ ],
+ "permissions": {
+ "customs": [{"description": "str", "name": "str"}],
+ "licenses": ["str"],
+ "resourceProvider": [
+ {
+ "permissionsDisplayText": "str",
+ "provider": "str",
+ "providerDisplayName": "str",
+ "requiredPermissions": {"action": bool, "delete": bool, "read": bool, "write": bool},
+ "scope": "str",
+ }
+ ],
+ "tenant": ["str"],
+ },
+ "publisher": "str",
+ "title": "str",
+ "availability": {"isPreview": bool, "status": 0},
+ "id": "str",
+ "isConnectivityCriteriasMatchSome": bool,
+ "logo": "str",
+ },
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "etag": "str",
+ "id": "str",
+ "lastModifiedUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connector_definitions_delete(self, resource_group):
+ response = await self.client.data_connector_definitions.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_definition_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations.py
new file mode 100644
index 000000000000..e6930a13a233
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations.py
@@ -0,0 +1,87 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsDataConnectorsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connectors_list(self, resource_group):
+ response = self.client.data_connectors.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connectors_get(self, resource_group):
+ response = self.client.data_connectors.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connectors_create_or_update(self, resource_group):
+ response = self.client.data_connectors.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_id="str",
+ data_connector={
+ "kind": "AmazonWebServicesCloudTrail",
+ "awsRoleArn": "str",
+ "dataTypes": {"logs": {"state": "str"}},
+ "etag": "str",
+ "id": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_data_connectors_delete(self, resource_group):
+ response = self.client.data_connectors.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations_async.py
new file mode 100644
index 000000000000..ceb35afbd22f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations_async.py
@@ -0,0 +1,88 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsDataConnectorsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connectors_list(self, resource_group):
+ response = self.client.data_connectors.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connectors_get(self, resource_group):
+ response = await self.client.data_connectors.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connectors_create_or_update(self, resource_group):
+ response = await self.client.data_connectors.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_id="str",
+ data_connector={
+ "kind": "AmazonWebServicesCloudTrail",
+ "awsRoleArn": "str",
+ "dataTypes": {"logs": {"state": "str"}},
+ "etag": "str",
+ "id": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_data_connectors_delete(self, resource_group):
+ response = await self.client.data_connectors.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ data_connector_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations.py
new file mode 100644
index 000000000000..f695590b8f7b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsEntitiesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_entities_run_playbook(self, resource_group):
+ response = self.client.entities.run_playbook(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ entity_identifier="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations_async.py
new file mode 100644
index 000000000000..34500a5cb91a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations_async.py
@@ -0,0 +1,33 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsEntitiesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_entities_run_playbook(self, resource_group):
+ response = await self.client.entities.run_playbook(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ entity_identifier="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations.py
new file mode 100644
index 000000000000..076d36488181
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations.py
@@ -0,0 +1,92 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentCommentsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_comments_list(self, resource_group):
+ response = self.client.incident_comments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_comments_get(self, resource_group):
+ response = self.client.incident_comments.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_comment_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_comments_create_or_update(self, resource_group):
+ response = self.client.incident_comments.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_comment_id="str",
+ incident_comment={
+ "author": {"email": "str", "name": "str", "objectId": "str", "userPrincipalName": "str"},
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "etag": "str",
+ "id": "str",
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "message": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_comments_delete(self, resource_group):
+ response = self.client.incident_comments.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_comment_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations_async.py
new file mode 100644
index 000000000000..6fd164b237d3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations_async.py
@@ -0,0 +1,93 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentCommentsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_comments_list(self, resource_group):
+ response = self.client.incident_comments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_comments_get(self, resource_group):
+ response = await self.client.incident_comments.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_comment_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_comments_create_or_update(self, resource_group):
+ response = await self.client.incident_comments.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_comment_id="str",
+ incident_comment={
+ "author": {"email": "str", "name": "str", "objectId": "str", "userPrincipalName": "str"},
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "etag": "str",
+ "id": "str",
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "message": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_comments_delete(self, resource_group):
+ response = await self.client.incident_comments.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_comment_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations.py
new file mode 100644
index 000000000000..7d33830ef023
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations.py
@@ -0,0 +1,92 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentRelationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_relations_list(self, resource_group):
+ response = self.client.incident_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_relations_get(self, resource_group):
+ response = self.client.incident_relations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ relation_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_relations_create_or_update(self, resource_group):
+ response = self.client.incident_relations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ relation_name="str",
+ relation={
+ "etag": "str",
+ "id": "str",
+ "name": "str",
+ "relatedResourceId": "str",
+ "relatedResourceKind": "str",
+ "relatedResourceName": "str",
+ "relatedResourceType": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_relations_delete(self, resource_group):
+ response = self.client.incident_relations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ relation_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations_async.py
new file mode 100644
index 000000000000..7538ad204b70
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations_async.py
@@ -0,0 +1,93 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentRelationsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_relations_list(self, resource_group):
+ response = self.client.incident_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_relations_get(self, resource_group):
+ response = await self.client.incident_relations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ relation_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_relations_create_or_update(self, resource_group):
+ response = await self.client.incident_relations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ relation_name="str",
+ relation={
+ "etag": "str",
+ "id": "str",
+ "name": "str",
+ "relatedResourceId": "str",
+ "relatedResourceKind": "str",
+ "relatedResourceName": "str",
+ "relatedResourceType": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_relations_delete(self, resource_group):
+ response = await self.client.incident_relations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ relation_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations.py
new file mode 100644
index 000000000000..2a50577f08ef
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations.py
@@ -0,0 +1,95 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentTasksOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_tasks_list(self, resource_group):
+ response = self.client.incident_tasks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_tasks_get(self, resource_group):
+ response = self.client.incident_tasks.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_task_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_tasks_create_or_update(self, resource_group):
+ response = self.client.incident_tasks.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_task_id="str",
+ incident_task={
+ "status": "str",
+ "title": "str",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str", "userPrincipalName": "str"},
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "description": "str",
+ "etag": "str",
+ "id": "str",
+ "lastModifiedBy": {"email": "str", "name": "str", "objectId": "str", "userPrincipalName": "str"},
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incident_tasks_delete(self, resource_group):
+ response = self.client.incident_tasks.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_task_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations_async.py
new file mode 100644
index 000000000000..43acfb63961c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations_async.py
@@ -0,0 +1,96 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentTasksOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_tasks_list(self, resource_group):
+ response = self.client.incident_tasks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_tasks_get(self, resource_group):
+ response = await self.client.incident_tasks.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_task_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_tasks_create_or_update(self, resource_group):
+ response = await self.client.incident_tasks.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_task_id="str",
+ incident_task={
+ "status": "str",
+ "title": "str",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str", "userPrincipalName": "str"},
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "description": "str",
+ "etag": "str",
+ "id": "str",
+ "lastModifiedBy": {"email": "str", "name": "str", "objectId": "str", "userPrincipalName": "str"},
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incident_tasks_delete(self, resource_group):
+ response = await self.client.incident_tasks.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident_task_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations.py
new file mode 100644
index 000000000000..feae29b93156
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations.py
@@ -0,0 +1,168 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_run_playbook(self, resource_group):
+ response = self.client.incidents.run_playbook(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_identifier="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_list(self, resource_group):
+ response = self.client.incidents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_get(self, resource_group):
+ response = self.client.incidents.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_create_or_update(self, resource_group):
+ response = self.client.incidents.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident={
+ "additionalData": {
+ "alertProductNames": ["str"],
+ "alertsCount": 0,
+ "bookmarksCount": 0,
+ "commentsCount": 0,
+ "providerIncidentUrl": "str",
+ "tactics": ["str"],
+ },
+ "classification": "str",
+ "classificationComment": "str",
+ "classificationReason": "str",
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "description": "str",
+ "etag": "str",
+ "firstActivityTimeUtc": "2020-02-20 00:00:00",
+ "id": "str",
+ "incidentNumber": 0,
+ "incidentUrl": "str",
+ "labels": [{"labelName": "str", "labelType": "str"}],
+ "lastActivityTimeUtc": "2020-02-20 00:00:00",
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "owner": {
+ "assignedTo": "str",
+ "email": "str",
+ "objectId": "str",
+ "ownerType": "str",
+ "userPrincipalName": "str",
+ },
+ "providerIncidentId": "str",
+ "providerName": "str",
+ "relatedAnalyticRuleIds": ["str"],
+ "severity": "str",
+ "status": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "title": "str",
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_delete(self, resource_group):
+ response = self.client.incidents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_list_alerts(self, resource_group):
+ response = self.client.incidents.list_alerts(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_list_bookmarks(self, resource_group):
+ response = self.client.incidents.list_bookmarks(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_incidents_list_entities(self, resource_group):
+ response = self.client.incidents.list_entities(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations_async.py
new file mode 100644
index 000000000000..fcc906b3dfa2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations_async.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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsIncidentsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_run_playbook(self, resource_group):
+ response = await self.client.incidents.run_playbook(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_identifier="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_list(self, resource_group):
+ response = self.client.incidents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_get(self, resource_group):
+ response = await self.client.incidents.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_create_or_update(self, resource_group):
+ response = await self.client.incidents.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ incident={
+ "additionalData": {
+ "alertProductNames": ["str"],
+ "alertsCount": 0,
+ "bookmarksCount": 0,
+ "commentsCount": 0,
+ "providerIncidentUrl": "str",
+ "tactics": ["str"],
+ },
+ "classification": "str",
+ "classificationComment": "str",
+ "classificationReason": "str",
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "description": "str",
+ "etag": "str",
+ "firstActivityTimeUtc": "2020-02-20 00:00:00",
+ "id": "str",
+ "incidentNumber": 0,
+ "incidentUrl": "str",
+ "labels": [{"labelName": "str", "labelType": "str"}],
+ "lastActivityTimeUtc": "2020-02-20 00:00:00",
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "owner": {
+ "assignedTo": "str",
+ "email": "str",
+ "objectId": "str",
+ "ownerType": "str",
+ "userPrincipalName": "str",
+ },
+ "providerIncidentId": "str",
+ "providerName": "str",
+ "relatedAnalyticRuleIds": ["str"],
+ "severity": "str",
+ "status": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "title": "str",
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_delete(self, resource_group):
+ response = await self.client.incidents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_list_alerts(self, resource_group):
+ response = await self.client.incidents.list_alerts(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_list_bookmarks(self, resource_group):
+ response = await self.client.incidents.list_bookmarks(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_incidents_list_entities(self, resource_group):
+ response = await self.client.incidents.list_entities(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ incident_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations.py
new file mode 100644
index 000000000000..54137ca1352e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations.py
@@ -0,0 +1,151 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsMetadataOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_metadata_list(self, resource_group):
+ response = self.client.metadata.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_metadata_get(self, resource_group):
+ response = self.client.metadata.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_metadata_delete(self, resource_group):
+ response = self.client.metadata.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_metadata_create(self, resource_group):
+ response = self.client.metadata.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ metadata={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "etag": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "id": "str",
+ "kind": "str",
+ "lastPublishDate": "2020-02-20",
+ "name": "str",
+ "parentId": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_metadata_update(self, resource_group):
+ response = self.client.metadata.update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ metadata_patch={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "kind": "str",
+ "lastPublishDate": "2020-02-20",
+ "parentId": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations_async.py
new file mode 100644
index 000000000000..25058dcb9b39
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations_async.py
@@ -0,0 +1,152 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsMetadataOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_metadata_list(self, resource_group):
+ response = self.client.metadata.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_metadata_get(self, resource_group):
+ response = await self.client.metadata.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_metadata_delete(self, resource_group):
+ response = await self.client.metadata.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_metadata_create(self, resource_group):
+ response = await self.client.metadata.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ metadata={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "etag": "str",
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "id": "str",
+ "kind": "str",
+ "lastPublishDate": "2020-02-20",
+ "name": "str",
+ "parentId": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_metadata_update(self, resource_group):
+ response = await self.client.metadata.update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ metadata_name="str",
+ metadata_patch={
+ "author": {"email": "str", "link": "str", "name": "str"},
+ "categories": {"domains": ["str"], "verticals": ["str"]},
+ "contentId": "str",
+ "contentSchemaVersion": "str",
+ "customVersion": "str",
+ "dependencies": {
+ "contentId": "str",
+ "criteria": [...],
+ "kind": "str",
+ "name": "str",
+ "operator": "str",
+ "version": "str",
+ },
+ "firstPublishDate": "2020-02-20",
+ "icon": "str",
+ "kind": "str",
+ "lastPublishDate": "2020-02-20",
+ "parentId": "str",
+ "previewImages": ["str"],
+ "previewImagesDark": ["str"],
+ "providers": ["str"],
+ "source": {"kind": "str", "name": "str", "sourceId": "str"},
+ "support": {"tier": "str", "email": "str", "link": "str", "name": "str"},
+ "threatAnalysisTactics": ["str"],
+ "threatAnalysisTechniques": ["str"],
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_operations.py
new file mode 100644
index 000000000000..cc7e10a54977
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_operations.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.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_operations_list(self, resource_group):
+ response = self.client.operations.list(
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_operations_async.py
new file mode 100644
index 000000000000..87e38eed1a2d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_operations_async.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.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_operations_list(self, resource_group):
+ response = self.client.operations.list(
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations.py
new file mode 100644
index 000000000000..5642364a315a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductPackageOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_product_package_get(self, resource_group):
+ response = self.client.product_package.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations_async.py
new file mode 100644
index 000000000000..340c5481ac44
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations_async.py
@@ -0,0 +1,33 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductPackageOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_product_package_get(self, resource_group):
+ response = await self.client.product_package.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ package_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_operations.py
new file mode 100644
index 000000000000..2f2aec96833e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductPackagesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_product_packages_list(self, resource_group):
+ response = self.client.product_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_operations_async.py
new file mode 100644
index 000000000000..fa80fa60623c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_operations_async.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductPackagesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_product_packages_list(self, resource_group):
+ response = self.client.product_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations.py
new file mode 100644
index 000000000000..baba3eed8cc2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductTemplateOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_product_template_get(self, resource_group):
+ response = self.client.product_template.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations_async.py
new file mode 100644
index 000000000000..a1f9ede36d34
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations_async.py
@@ -0,0 +1,33 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductTemplateOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_product_template_get(self, resource_group):
+ response = await self.client.product_template.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ template_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_operations.py
new file mode 100644
index 000000000000..563fc79350ce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductTemplatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_product_templates_list(self, resource_group):
+ response = self.client.product_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_operations_async.py
new file mode 100644
index 000000000000..2228f71dbba8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_operations_async.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsProductTemplatesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_product_templates_list(self, resource_group):
+ response = self.client.product_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations.py
new file mode 100644
index 000000000000..11f3f9b0f133
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations.py
@@ -0,0 +1,99 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSecurityMLAnalyticsSettingsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_security_ml_analytics_settings_list(self, resource_group):
+ response = self.client.security_ml_analytics_settings.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_security_ml_analytics_settings_get(self, resource_group):
+ response = self.client.security_ml_analytics_settings.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ settings_resource_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_security_ml_analytics_settings_create_or_update(self, resource_group):
+ response = self.client.security_ml_analytics_settings.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ settings_resource_name="str",
+ security_ml_analytics_setting={
+ "kind": "Anomaly",
+ "anomalySettingsVersion": 0,
+ "anomalyVersion": "str",
+ "customizableObservations": {},
+ "description": "str",
+ "displayName": "str",
+ "enabled": bool,
+ "etag": "str",
+ "frequency": "1 day, 0:00:00",
+ "id": "str",
+ "isDefaultSettings": bool,
+ "lastModifiedUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "requiredDataConnectors": [{"connectorId": "str", "dataTypes": ["str"]}],
+ "settingsDefinitionId": "str",
+ "settingsStatus": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tactics": ["str"],
+ "techniques": ["str"],
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_security_ml_analytics_settings_delete(self, resource_group):
+ response = self.client.security_ml_analytics_settings.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ settings_resource_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations_async.py
new file mode 100644
index 000000000000..f72543ae1ca2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations_async.py
@@ -0,0 +1,100 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSecurityMLAnalyticsSettingsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_security_ml_analytics_settings_list(self, resource_group):
+ response = self.client.security_ml_analytics_settings.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_security_ml_analytics_settings_get(self, resource_group):
+ response = await self.client.security_ml_analytics_settings.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ settings_resource_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_security_ml_analytics_settings_create_or_update(self, resource_group):
+ response = await self.client.security_ml_analytics_settings.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ settings_resource_name="str",
+ security_ml_analytics_setting={
+ "kind": "Anomaly",
+ "anomalySettingsVersion": 0,
+ "anomalyVersion": "str",
+ "customizableObservations": {},
+ "description": "str",
+ "displayName": "str",
+ "enabled": bool,
+ "etag": "str",
+ "frequency": "1 day, 0:00:00",
+ "id": "str",
+ "isDefaultSettings": bool,
+ "lastModifiedUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "requiredDataConnectors": [{"connectorId": "str", "dataTypes": ["str"]}],
+ "settingsDefinitionId": "str",
+ "settingsStatus": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tactics": ["str"],
+ "techniques": ["str"],
+ "type": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_security_ml_analytics_settings_delete(self, resource_group):
+ response = await self.client.security_ml_analytics_settings.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ settings_resource_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations.py
new file mode 100644
index 000000000000..9e1afabc73c5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations.py
@@ -0,0 +1,70 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSentinelOnboardingStatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_sentinel_onboarding_states_get(self, resource_group):
+ response = self.client.sentinel_onboarding_states.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ sentinel_onboarding_state_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_sentinel_onboarding_states_create(self, resource_group):
+ response = self.client.sentinel_onboarding_states.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ sentinel_onboarding_state_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_sentinel_onboarding_states_delete(self, resource_group):
+ response = self.client.sentinel_onboarding_states.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ sentinel_onboarding_state_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_sentinel_onboarding_states_list(self, resource_group):
+ response = self.client.sentinel_onboarding_states.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations_async.py
new file mode 100644
index 000000000000..9152f413ac78
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations_async.py
@@ -0,0 +1,71 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSentinelOnboardingStatesOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_sentinel_onboarding_states_get(self, resource_group):
+ response = await self.client.sentinel_onboarding_states.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ sentinel_onboarding_state_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_sentinel_onboarding_states_create(self, resource_group):
+ response = await self.client.sentinel_onboarding_states.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ sentinel_onboarding_state_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_sentinel_onboarding_states_delete(self, resource_group):
+ response = await self.client.sentinel_onboarding_states.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ sentinel_onboarding_state_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_sentinel_onboarding_states_list(self, resource_group):
+ response = await self.client.sentinel_onboarding_states.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations.py
new file mode 100644
index 000000000000..915a9c6c47ce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations.py
@@ -0,0 +1,39 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSourceControlOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_source_control_list_repositories(self, resource_group):
+ response = self.client.source_control.list_repositories(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ repository_access={
+ "kind": "str",
+ "clientId": "str",
+ "code": "str",
+ "installationId": "str",
+ "state": "str",
+ "token": "str",
+ },
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations_async.py
new file mode 100644
index 000000000000..0eac6461f952
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations_async.py
@@ -0,0 +1,40 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSourceControlOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_source_control_list_repositories(self, resource_group):
+ response = self.client.source_control.list_repositories(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ repository_access={
+ "kind": "str",
+ "clientId": "str",
+ "code": "str",
+ "installationId": "str",
+ "state": "str",
+ "token": "str",
+ },
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations.py
new file mode 100644
index 000000000000..eff3277f4cfc
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations.py
@@ -0,0 +1,134 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSourceControlsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_source_controls_list(self, resource_group):
+ response = self.client.source_controls.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_source_controls_get(self, resource_group):
+ response = self.client.source_controls.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ source_control_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_source_controls_create(self, resource_group):
+ response = self.client.source_controls.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ source_control_id="str",
+ source_control={
+ "contentTypes": ["str"],
+ "displayName": "str",
+ "repoType": "str",
+ "repository": {"branch": "str", "url": "str", "deploymentLogsUrl": "str", "displayUrl": "str"},
+ "description": "str",
+ "etag": "str",
+ "id": "str",
+ "lastDeploymentInfo": {
+ "deployment": {
+ "deploymentId": "str",
+ "deploymentLogsUrl": "str",
+ "deploymentResult": "str",
+ "deploymentState": "str",
+ "deploymentTime": "2020-02-20 00:00:00",
+ },
+ "deploymentFetchStatus": "str",
+ "message": "str",
+ },
+ "name": "str",
+ "pullRequest": {"state": "str", "url": "str"},
+ "repositoryAccess": {
+ "kind": "str",
+ "clientId": "str",
+ "code": "str",
+ "installationId": "str",
+ "state": "str",
+ "token": "str",
+ },
+ "repositoryResourceInfo": {
+ "azureDevOpsResourceInfo": {"pipelineId": "str", "serviceConnectionId": "str"},
+ "gitHubResourceInfo": {"appInstallationId": "str"},
+ "webhook": {
+ "rotateWebhookSecret": bool,
+ "webhookId": "str",
+ "webhookSecretUpdateTime": "2020-02-20 00:00:00",
+ "webhookUrl": "str",
+ },
+ },
+ "servicePrincipal": {
+ "appId": "str",
+ "credentialsExpireOn": "2020-02-20 00:00:00",
+ "id": "str",
+ "tenantId": "str",
+ },
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_source_controls_delete(self, resource_group):
+ response = self.client.source_controls.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ source_control_id="str",
+ repository_access={
+ "kind": "str",
+ "clientId": "str",
+ "code": "str",
+ "installationId": "str",
+ "state": "str",
+ "token": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations_async.py
new file mode 100644
index 000000000000..fdd84dcb454d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations_async.py
@@ -0,0 +1,135 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsSourceControlsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_source_controls_list(self, resource_group):
+ response = self.client.source_controls.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_source_controls_get(self, resource_group):
+ response = await self.client.source_controls.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ source_control_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_source_controls_create(self, resource_group):
+ response = await self.client.source_controls.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ source_control_id="str",
+ source_control={
+ "contentTypes": ["str"],
+ "displayName": "str",
+ "repoType": "str",
+ "repository": {"branch": "str", "url": "str", "deploymentLogsUrl": "str", "displayUrl": "str"},
+ "description": "str",
+ "etag": "str",
+ "id": "str",
+ "lastDeploymentInfo": {
+ "deployment": {
+ "deploymentId": "str",
+ "deploymentLogsUrl": "str",
+ "deploymentResult": "str",
+ "deploymentState": "str",
+ "deploymentTime": "2020-02-20 00:00:00",
+ },
+ "deploymentFetchStatus": "str",
+ "message": "str",
+ },
+ "name": "str",
+ "pullRequest": {"state": "str", "url": "str"},
+ "repositoryAccess": {
+ "kind": "str",
+ "clientId": "str",
+ "code": "str",
+ "installationId": "str",
+ "state": "str",
+ "token": "str",
+ },
+ "repositoryResourceInfo": {
+ "azureDevOpsResourceInfo": {"pipelineId": "str", "serviceConnectionId": "str"},
+ "gitHubResourceInfo": {"appInstallationId": "str"},
+ "webhook": {
+ "rotateWebhookSecret": bool,
+ "webhookId": "str",
+ "webhookSecretUpdateTime": "2020-02-20 00:00:00",
+ "webhookUrl": "str",
+ },
+ },
+ "servicePrincipal": {
+ "appId": "str",
+ "credentialsExpireOn": "2020-02-20 00:00:00",
+ "id": "str",
+ "tenantId": "str",
+ },
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ "version": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_source_controls_delete(self, resource_group):
+ response = await self.client.source_controls.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ source_control_id="str",
+ repository_access={
+ "kind": "str",
+ "clientId": "str",
+ "code": "str",
+ "installationId": "str",
+ "state": "str",
+ "token": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_operations.py
new file mode 100644
index 000000000000..89f2e1d12165
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsThreatIntelligenceIndicatorMetricsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_metrics_list(self, resource_group):
+ response = self.client.threat_intelligence_indicator_metrics.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_operations_async.py
new file mode 100644
index 000000000000..e351b8c6c608
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_operations_async.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsThreatIntelligenceIndicatorMetricsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_metrics_list(self, resource_group):
+ response = await self.client.threat_intelligence_indicator_metrics.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations.py
new file mode 100644
index 000000000000..9cee7352003a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations.py
@@ -0,0 +1,289 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsThreatIntelligenceIndicatorOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_create_indicator(self, resource_group):
+ response = self.client.threat_intelligence_indicator.create_indicator(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ threat_intelligence_properties={
+ "kind": "indicator",
+ "additionalData": {"str": {}},
+ "confidence": 0,
+ "created": "str",
+ "createdByRef": "str",
+ "defanged": bool,
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "extensions": {"str": {}},
+ "externalId": "str",
+ "externalLastUpdatedTimeUtc": "str",
+ "externalReferences": [
+ {
+ "description": "str",
+ "externalId": "str",
+ "hashes": {"str": "str"},
+ "sourceName": "str",
+ "url": "str",
+ }
+ ],
+ "friendlyName": "str",
+ "granularMarkings": [{"language": "str", "markingRef": 0, "selectors": ["str"]}],
+ "id": "str",
+ "indicatorTypes": ["str"],
+ "killChainPhases": [{"killChainName": "str", "phaseName": "str"}],
+ "labels": ["str"],
+ "language": "str",
+ "lastUpdatedTimeUtc": "str",
+ "modified": "str",
+ "name": "str",
+ "objectMarkingRefs": ["str"],
+ "parsedPattern": [
+ {"patternTypeKey": "str", "patternTypeValues": [{"value": "str", "valueType": "str"}]}
+ ],
+ "pattern": "str",
+ "patternType": "str",
+ "patternVersion": "str",
+ "revoked": bool,
+ "source": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatIntelligenceTags": ["str"],
+ "threatTypes": ["str"],
+ "type": "str",
+ "validFrom": "str",
+ "validUntil": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_get(self, resource_group):
+ response = self.client.threat_intelligence_indicator.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_create(self, resource_group):
+ response = self.client.threat_intelligence_indicator.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ threat_intelligence_properties={
+ "kind": "indicator",
+ "additionalData": {"str": {}},
+ "confidence": 0,
+ "created": "str",
+ "createdByRef": "str",
+ "defanged": bool,
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "extensions": {"str": {}},
+ "externalId": "str",
+ "externalLastUpdatedTimeUtc": "str",
+ "externalReferences": [
+ {
+ "description": "str",
+ "externalId": "str",
+ "hashes": {"str": "str"},
+ "sourceName": "str",
+ "url": "str",
+ }
+ ],
+ "friendlyName": "str",
+ "granularMarkings": [{"language": "str", "markingRef": 0, "selectors": ["str"]}],
+ "id": "str",
+ "indicatorTypes": ["str"],
+ "killChainPhases": [{"killChainName": "str", "phaseName": "str"}],
+ "labels": ["str"],
+ "language": "str",
+ "lastUpdatedTimeUtc": "str",
+ "modified": "str",
+ "name": "str",
+ "objectMarkingRefs": ["str"],
+ "parsedPattern": [
+ {"patternTypeKey": "str", "patternTypeValues": [{"value": "str", "valueType": "str"}]}
+ ],
+ "pattern": "str",
+ "patternType": "str",
+ "patternVersion": "str",
+ "revoked": bool,
+ "source": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatIntelligenceTags": ["str"],
+ "threatTypes": ["str"],
+ "type": "str",
+ "validFrom": "str",
+ "validUntil": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_delete(self, resource_group):
+ response = self.client.threat_intelligence_indicator.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_query_indicators(self, resource_group):
+ response = self.client.threat_intelligence_indicator.query_indicators(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ threat_intelligence_filtering_criteria={
+ "ids": ["str"],
+ "includeDisabled": bool,
+ "keywords": ["str"],
+ "maxConfidence": 0,
+ "maxValidUntil": "str",
+ "minConfidence": 0,
+ "minValidUntil": "str",
+ "pageSize": 0,
+ "patternTypes": ["str"],
+ "skipToken": "str",
+ "sortBy": [{"itemKey": "str", "sortOrder": "str"}],
+ "sources": ["str"],
+ "threatTypes": ["str"],
+ },
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_append_tags(self, resource_group):
+ response = self.client.threat_intelligence_indicator.append_tags(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ threat_intelligence_append_tags={"threatIntelligenceTags": ["str"]},
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicator_replace_tags(self, resource_group):
+ response = self.client.threat_intelligence_indicator.replace_tags(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ threat_intelligence_replace_tags={
+ "kind": "indicator",
+ "additionalData": {"str": {}},
+ "confidence": 0,
+ "created": "str",
+ "createdByRef": "str",
+ "defanged": bool,
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "extensions": {"str": {}},
+ "externalId": "str",
+ "externalLastUpdatedTimeUtc": "str",
+ "externalReferences": [
+ {
+ "description": "str",
+ "externalId": "str",
+ "hashes": {"str": "str"},
+ "sourceName": "str",
+ "url": "str",
+ }
+ ],
+ "friendlyName": "str",
+ "granularMarkings": [{"language": "str", "markingRef": 0, "selectors": ["str"]}],
+ "id": "str",
+ "indicatorTypes": ["str"],
+ "killChainPhases": [{"killChainName": "str", "phaseName": "str"}],
+ "labels": ["str"],
+ "language": "str",
+ "lastUpdatedTimeUtc": "str",
+ "modified": "str",
+ "name": "str",
+ "objectMarkingRefs": ["str"],
+ "parsedPattern": [
+ {"patternTypeKey": "str", "patternTypeValues": [{"value": "str", "valueType": "str"}]}
+ ],
+ "pattern": "str",
+ "patternType": "str",
+ "patternVersion": "str",
+ "revoked": bool,
+ "source": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatIntelligenceTags": ["str"],
+ "threatTypes": ["str"],
+ "type": "str",
+ "validFrom": "str",
+ "validUntil": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations_async.py
new file mode 100644
index 000000000000..6cf0cfc0292b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations_async.py
@@ -0,0 +1,290 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsThreatIntelligenceIndicatorOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_create_indicator(self, resource_group):
+ response = await self.client.threat_intelligence_indicator.create_indicator(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ threat_intelligence_properties={
+ "kind": "indicator",
+ "additionalData": {"str": {}},
+ "confidence": 0,
+ "created": "str",
+ "createdByRef": "str",
+ "defanged": bool,
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "extensions": {"str": {}},
+ "externalId": "str",
+ "externalLastUpdatedTimeUtc": "str",
+ "externalReferences": [
+ {
+ "description": "str",
+ "externalId": "str",
+ "hashes": {"str": "str"},
+ "sourceName": "str",
+ "url": "str",
+ }
+ ],
+ "friendlyName": "str",
+ "granularMarkings": [{"language": "str", "markingRef": 0, "selectors": ["str"]}],
+ "id": "str",
+ "indicatorTypes": ["str"],
+ "killChainPhases": [{"killChainName": "str", "phaseName": "str"}],
+ "labels": ["str"],
+ "language": "str",
+ "lastUpdatedTimeUtc": "str",
+ "modified": "str",
+ "name": "str",
+ "objectMarkingRefs": ["str"],
+ "parsedPattern": [
+ {"patternTypeKey": "str", "patternTypeValues": [{"value": "str", "valueType": "str"}]}
+ ],
+ "pattern": "str",
+ "patternType": "str",
+ "patternVersion": "str",
+ "revoked": bool,
+ "source": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatIntelligenceTags": ["str"],
+ "threatTypes": ["str"],
+ "type": "str",
+ "validFrom": "str",
+ "validUntil": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_get(self, resource_group):
+ response = await self.client.threat_intelligence_indicator.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_create(self, resource_group):
+ response = await self.client.threat_intelligence_indicator.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ threat_intelligence_properties={
+ "kind": "indicator",
+ "additionalData": {"str": {}},
+ "confidence": 0,
+ "created": "str",
+ "createdByRef": "str",
+ "defanged": bool,
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "extensions": {"str": {}},
+ "externalId": "str",
+ "externalLastUpdatedTimeUtc": "str",
+ "externalReferences": [
+ {
+ "description": "str",
+ "externalId": "str",
+ "hashes": {"str": "str"},
+ "sourceName": "str",
+ "url": "str",
+ }
+ ],
+ "friendlyName": "str",
+ "granularMarkings": [{"language": "str", "markingRef": 0, "selectors": ["str"]}],
+ "id": "str",
+ "indicatorTypes": ["str"],
+ "killChainPhases": [{"killChainName": "str", "phaseName": "str"}],
+ "labels": ["str"],
+ "language": "str",
+ "lastUpdatedTimeUtc": "str",
+ "modified": "str",
+ "name": "str",
+ "objectMarkingRefs": ["str"],
+ "parsedPattern": [
+ {"patternTypeKey": "str", "patternTypeValues": [{"value": "str", "valueType": "str"}]}
+ ],
+ "pattern": "str",
+ "patternType": "str",
+ "patternVersion": "str",
+ "revoked": bool,
+ "source": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatIntelligenceTags": ["str"],
+ "threatTypes": ["str"],
+ "type": "str",
+ "validFrom": "str",
+ "validUntil": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_delete(self, resource_group):
+ response = await self.client.threat_intelligence_indicator.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_query_indicators(self, resource_group):
+ response = self.client.threat_intelligence_indicator.query_indicators(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ threat_intelligence_filtering_criteria={
+ "ids": ["str"],
+ "includeDisabled": bool,
+ "keywords": ["str"],
+ "maxConfidence": 0,
+ "maxValidUntil": "str",
+ "minConfidence": 0,
+ "minValidUntil": "str",
+ "pageSize": 0,
+ "patternTypes": ["str"],
+ "skipToken": "str",
+ "sortBy": [{"itemKey": "str", "sortOrder": "str"}],
+ "sources": ["str"],
+ "threatTypes": ["str"],
+ },
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_append_tags(self, resource_group):
+ response = await self.client.threat_intelligence_indicator.append_tags(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ threat_intelligence_append_tags={"threatIntelligenceTags": ["str"]},
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicator_replace_tags(self, resource_group):
+ response = await self.client.threat_intelligence_indicator.replace_tags(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ name="str",
+ threat_intelligence_replace_tags={
+ "kind": "indicator",
+ "additionalData": {"str": {}},
+ "confidence": 0,
+ "created": "str",
+ "createdByRef": "str",
+ "defanged": bool,
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "extensions": {"str": {}},
+ "externalId": "str",
+ "externalLastUpdatedTimeUtc": "str",
+ "externalReferences": [
+ {
+ "description": "str",
+ "externalId": "str",
+ "hashes": {"str": "str"},
+ "sourceName": "str",
+ "url": "str",
+ }
+ ],
+ "friendlyName": "str",
+ "granularMarkings": [{"language": "str", "markingRef": 0, "selectors": ["str"]}],
+ "id": "str",
+ "indicatorTypes": ["str"],
+ "killChainPhases": [{"killChainName": "str", "phaseName": "str"}],
+ "labels": ["str"],
+ "language": "str",
+ "lastUpdatedTimeUtc": "str",
+ "modified": "str",
+ "name": "str",
+ "objectMarkingRefs": ["str"],
+ "parsedPattern": [
+ {"patternTypeKey": "str", "patternTypeValues": [{"value": "str", "valueType": "str"}]}
+ ],
+ "pattern": "str",
+ "patternType": "str",
+ "patternVersion": "str",
+ "revoked": bool,
+ "source": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "threatIntelligenceTags": ["str"],
+ "threatTypes": ["str"],
+ "type": "str",
+ "validFrom": "str",
+ "validUntil": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_operations.py
new file mode 100644
index 000000000000..d75470bab4ce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsThreatIntelligenceIndicatorsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_threat_intelligence_indicators_list(self, resource_group):
+ response = self.client.threat_intelligence_indicators.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_operations_async.py
new file mode 100644
index 000000000000..621086e40ca5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_operations_async.py
@@ -0,0 +1,32 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsThreatIntelligenceIndicatorsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_threat_intelligence_indicators_list(self, resource_group):
+ response = self.client.threat_intelligence_indicators.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations.py
new file mode 100644
index 000000000000..2b0c8bf07d7e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations.py
@@ -0,0 +1,98 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsWatchlistItemsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlist_items_list(self, resource_group):
+ response = self.client.watchlist_items.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlist_items_get(self, resource_group):
+ response = self.client.watchlist_items.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist_item_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlist_items_delete(self, resource_group):
+ response = self.client.watchlist_items.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist_item_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlist_items_create_or_update(self, resource_group):
+ response = self.client.watchlist_items.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist_item_id="str",
+ watchlist_item={
+ "created": "2020-02-20 00:00:00",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str"},
+ "entityMapping": {},
+ "etag": "str",
+ "id": "str",
+ "isDeleted": bool,
+ "itemsKeyValue": {},
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tenantId": "str",
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {"email": "str", "name": "str", "objectId": "str"},
+ "watchlistItemId": "str",
+ "watchlistItemType": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations_async.py
new file mode 100644
index 000000000000..1270d4cbf7e8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations_async.py
@@ -0,0 +1,99 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsWatchlistItemsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlist_items_list(self, resource_group):
+ response = self.client.watchlist_items.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlist_items_get(self, resource_group):
+ response = await self.client.watchlist_items.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist_item_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlist_items_delete(self, resource_group):
+ response = await self.client.watchlist_items.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist_item_id="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlist_items_create_or_update(self, resource_group):
+ response = await self.client.watchlist_items.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist_item_id="str",
+ watchlist_item={
+ "created": "2020-02-20 00:00:00",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str"},
+ "entityMapping": {},
+ "etag": "str",
+ "id": "str",
+ "isDeleted": bool,
+ "itemsKeyValue": {},
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tenantId": "str",
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {"email": "str", "name": "str", "objectId": "str"},
+ "watchlistItemId": "str",
+ "watchlistItemType": "str",
+ },
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations.py
new file mode 100644
index 000000000000..a4930d5d3c35
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations.py
@@ -0,0 +1,106 @@
+# 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 pytest
+from azure.mgmt.securityinsight import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsWatchlistsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlists_list(self, resource_group):
+ response = self.client.watchlists.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlists_get(self, resource_group):
+ response = self.client.watchlists.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlists_begin_delete(self, resource_group):
+ response = self.client.watchlists.begin_delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ api_version="2025-03-01",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_watchlists_begin_create_or_update(self, resource_group):
+ response = self.client.watchlists.begin_create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist={
+ "contentType": "str",
+ "created": "2020-02-20 00:00:00",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str"},
+ "defaultDuration": "1 day, 0:00:00",
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "id": "str",
+ "isDeleted": bool,
+ "itemsSearchKey": "str",
+ "labels": ["str"],
+ "name": "str",
+ "numberOfLinesToSkip": 0,
+ "provider": "str",
+ "provisioningState": "str",
+ "rawContent": "str",
+ "source": "str",
+ "sourceType": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tenantId": "str",
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {"email": "str", "name": "str", "objectId": "str"},
+ "uploadStatus": "str",
+ "watchlistAlias": "str",
+ "watchlistId": "str",
+ "watchlistType": "str",
+ },
+ api_version="2025-03-01",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations_async.py
new file mode 100644
index 000000000000..4297f4d0d196
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations_async.py
@@ -0,0 +1,111 @@
+# 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 pytest
+from azure.mgmt.securityinsight.aio import SecurityInsights
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestSecurityInsightsWatchlistsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlists_list(self, resource_group):
+ response = self.client.watchlists.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ api_version="2025-03-01",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlists_get(self, resource_group):
+ response = await self.client.watchlists.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ api_version="2025-03-01",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlists_begin_delete(self, resource_group):
+ response = await (
+ await self.client.watchlists.begin_delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ api_version="2025-03-01",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_watchlists_begin_create_or_update(self, resource_group):
+ response = await (
+ await self.client.watchlists.begin_create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str",
+ watchlist_alias="str",
+ watchlist={
+ "contentType": "str",
+ "created": "2020-02-20 00:00:00",
+ "createdBy": {"email": "str", "name": "str", "objectId": "str"},
+ "defaultDuration": "1 day, 0:00:00",
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "id": "str",
+ "isDeleted": bool,
+ "itemsSearchKey": "str",
+ "labels": ["str"],
+ "name": "str",
+ "numberOfLinesToSkip": 0,
+ "provider": "str",
+ "provisioningState": "str",
+ "rawContent": "str",
+ "source": "str",
+ "sourceType": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "tenantId": "str",
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {"email": "str", "name": "str", "objectId": "str"},
+ "uploadStatus": "str",
+ "watchlistAlias": "str",
+ "watchlistId": "str",
+ "watchlistType": "str",
+ },
+ api_version="2025-03-01",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/setup.py b/sdk/securityinsight/azure-mgmt-securityinsight/setup.py
index 73a9001cd3fd..fb4e6f0ead80 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/setup.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/setup.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python
-#-------------------------------------------------------------------------
+# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
-#--------------------------------------------------------------------------
+# --------------------------------------------------------------------------
import re
import os.path
@@ -16,64 +16,68 @@
PACKAGE_PPRINT_NAME = "Security Insight Management"
# a-b-c => a/b/c
-package_folder_path = PACKAGE_NAME.replace('-', '/')
+package_folder_path = PACKAGE_NAME.replace("-", "/")
# a-b-c => a.b.c
-namespace_name = PACKAGE_NAME.replace('-', '.')
+namespace_name = PACKAGE_NAME.replace("-", ".")
# Version extraction inspired from 'requests'
-with open(os.path.join(package_folder_path, 'version.py')
- if os.path.exists(os.path.join(package_folder_path, 'version.py'))
- else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
- version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
- fd.read(), re.MULTILINE).group(1)
+with open(
+ os.path.join(package_folder_path, "version.py")
+ if os.path.exists(os.path.join(package_folder_path, "version.py"))
+ else os.path.join(package_folder_path, "_version.py"),
+ "r",
+) as fd:
+ version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
if not version:
- raise RuntimeError('Cannot find version information')
+ raise RuntimeError("Cannot find version information")
-with open('README.md', encoding='utf-8') as f:
+with open("README.md", encoding="utf-8") as f:
readme = f.read()
-with open('CHANGELOG.md', encoding='utf-8') as f:
+with open("CHANGELOG.md", encoding="utf-8") as f:
changelog = f.read()
setup(
name=PACKAGE_NAME,
version=version,
- description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
- long_description=readme + '\n\n' + changelog,
- long_description_content_type='text/markdown',
- license='MIT License',
- author='Microsoft Corporation',
- author_email='azpysdkhelp@microsoft.com',
- url='https://github.com/Azure/azure-sdk-for-python',
+ description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME),
+ long_description=readme + "\n\n" + changelog,
+ long_description_content_type="text/markdown",
+ license="MIT License",
+ author="Microsoft Corporation",
+ author_email="azpysdkhelp@microsoft.com",
+ url="https://github.com/Azure/azure-sdk-for-python",
keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product
classifiers=[
- 'Development Status :: 4 - Beta',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 3 :: Only',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
- 'Programming Language :: Python :: 3.11',
- 'License :: OSI Approved :: MIT License',
+ "Development Status :: 4 - Beta",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3 :: Only",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "License :: OSI Approved :: MIT License",
],
zip_safe=False,
- packages=find_packages(exclude=[
- 'tests',
- # Exclude packages that will be covered by PEP420 or nspkg
- 'azure',
- 'azure.mgmt',
- ]),
+ packages=find_packages(
+ exclude=[
+ "tests",
+ # Exclude packages that will be covered by PEP420 or nspkg
+ "azure",
+ "azure.mgmt",
+ ]
+ ),
include_package_data=True,
package_data={
- 'pytyped': ['py.typed'],
+ "pytyped": ["py.typed"],
},
install_requires=[
- "msrest>=0.7.1",
- "azure-common~=1.1",
- "azure-mgmt-core>=1.3.2,<2.0.0",
- "typing-extensions>=4.3.0; python_version<'3.8.0'",
+ "isodate>=0.6.1",
+ "typing-extensions>=4.6.0",
+ "azure-common>=1.1",
+ "azure-mgmt-core>=1.3.2",
],
- python_requires=">=3.7"
+ python_requires=">=3.8",
)